diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-01-27 16:11:05 -0600 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-01-27 16:15:18 -0600 |
commit | 1da62670656ea9f606cf27796fce76ed8291dff8 (patch) | |
tree | f16f549577b39a2c14c97cb715bb941f12fe55e4 /spec/features/issues | |
parent | ffc5ec7d7723d429661d9f3e27a8be98a7976359 (diff) | |
download | gitlab-ce-1da62670656ea9f606cf27796fce76ed8291dff8.tar.gz |
Improved code style on the issue_sidebar_spec.rb
Diffstat (limited to 'spec/features/issues')
-rw-r--r-- | spec/features/issues/issue_sidebar_spec.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 64f7835eecd..1eb981942ea 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -1,7 +1,8 @@ require 'rails_helper' feature 'Issue Sidebar', feature: true do - include WaitForAjax, MobileHelpers + include WaitForAjax + include MobileHelpers let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } @@ -67,19 +68,12 @@ feature 'Issue Sidebar', feature: true do # Make sure the sidebar is collapsed expect(page).to have_css(sidebar_selector) # Once is collapsed let's open the sidebard and reload - page.within(sidebar_selector) do - find('.js-sidebar-toggle').click - # we wait a bit so the sidebar finishes it's animation - sleep 1 - end + open_issue_sidebar refresh expect(page).to have_css(sidebar_selector) # Restore the window size as it was including the sidebar restore_window_size - page.within(sidebar_selector) do - find('.js-sidebar-toggle').click - sleep 1 - end + open_issue_sidebar end end @@ -133,4 +127,11 @@ feature 'Issue Sidebar', feature: true do def visit_issue(project, issue) visit namespace_project_issue_path(project.namespace, project, issue) end + + def open_issue_sidebar + page.within('aside.right-sidebar.right-sidebar-collapsed') do + find('.js-sidebar-toggle').click + sleep 1 + end + end end |