Commit 1da62670 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Improved code style on the issue_sidebar_spec.rb

parent ffc5ec7d
require 'rails_helper' require 'rails_helper'
feature 'Issue Sidebar', feature: true do feature 'Issue Sidebar', feature: true do
include WaitForAjax, MobileHelpers include WaitForAjax
include MobileHelpers
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
...@@ -67,19 +68,12 @@ feature 'Issue Sidebar', feature: true do ...@@ -67,19 +68,12 @@ feature 'Issue Sidebar', feature: true do
# Make sure the sidebar is collapsed # Make sure the sidebar is collapsed
expect(page).to have_css(sidebar_selector) expect(page).to have_css(sidebar_selector)
# Once is collapsed let's open the sidebard and reload # Once is collapsed let's open the sidebard and reload
page.within(sidebar_selector) do open_issue_sidebar
find('.js-sidebar-toggle').click
# we wait a bit so the sidebar finishes it's animation
sleep 1
end
refresh refresh
expect(page).to have_css(sidebar_selector) expect(page).to have_css(sidebar_selector)
# Restore the window size as it was including the sidebar # Restore the window size as it was including the sidebar
restore_window_size restore_window_size
page.within(sidebar_selector) do open_issue_sidebar
find('.js-sidebar-toggle').click
sleep 1
end
end end
end end
...@@ -133,4 +127,11 @@ feature 'Issue Sidebar', feature: true do ...@@ -133,4 +127,11 @@ feature 'Issue Sidebar', feature: true do
def visit_issue(project, issue) def visit_issue(project, issue)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
end end
def open_issue_sidebar
page.within('aside.right-sidebar.right-sidebar-collapsed') do
find('.js-sidebar-toggle').click
sleep 1
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment