diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-07-07 16:51:34 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-07-07 16:57:28 +0300 |
commit | 78dd2f056fac9077c85c4e1b3d9d42abaa7aed05 (patch) | |
tree | 7763c6bdf543fa21c67ea3b46e1f70b1928a222b /spec/features/issuables | |
parent | f0f94278d80f06f01808f6301a1a43d5ab06cef2 (diff) |
Added issuables_helper.js, tidied up droplab-dropdown JS, fixed filtered search specs
Diffstat (limited to 'spec/features/issuables')
-rw-r--r-- | spec/features/issuables/close_reopen_report_toggle_spec.rb | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/spec/features/issuables/close_reopen_report_toggle_spec.rb b/spec/features/issuables/close_reopen_report_toggle_spec.rb index 38e8ca3eb36..361f14e4366 100644 --- a/spec/features/issuables/close_reopen_report_toggle_spec.rb +++ b/spec/features/issuables/close_reopen_report_toggle_spec.rb @@ -1,45 +1,45 @@ require 'spec_helper' -shared_examples 'an issuable close/reopen/report toggle' do - let(:container) { find('.issuable-close-dropdown') } - let(:human_model_name) { issuable.model_name.human.downcase } +describe 'Issuables Close/Reopen/Report toggle', :feature do + let(:user) { create(:user) } - it 'shows toggle' do - expect(page).to have_link("Close #{human_model_name}") - expect(page).to have_selector('.issuable-close-dropdown') - end + shared_examples 'an issuable close/reopen/report toggle' do + let(:container) { find('.issuable-close-dropdown') } + let(:human_model_name) { issuable.model_name.human.downcase } - it 'opens a dropdown when toggle is clicked' do - container.find('.dropdown-toggle').click - - expect(container).to have_selector('.dropdown-menu') - expect(container).to have_content("Close #{human_model_name}") - expect(container).to have_content('Report abuse') - expect(container).to have_content("Report #{human_model_name.pluralize} that are abusive, inappropriate or spam.") - expect(container).to have_selector('.close-item.droplab-item-selected') - expect(container).to have_selector('.report-item') - expect(container).not_to have_selector('.report-item.droplab-item-selected') - expect(container).not_to have_selector('.reopen-item') - end + it 'shows toggle' do + expect(page).to have_link("Close #{human_model_name}") + expect(page).to have_selector('.issuable-close-dropdown') + end + + it 'opens a dropdown when toggle is clicked' do + container.find('.dropdown-toggle').click + + expect(container).to have_selector('.dropdown-menu') + expect(container).to have_content("Close #{human_model_name}") + expect(container).to have_content('Report abuse') + expect(container).to have_content("Report #{human_model_name.pluralize} that are abusive, inappropriate or spam.") + expect(container).to have_selector('.close-item.droplab-item-selected') + expect(container).to have_selector('.report-item') + expect(container).not_to have_selector('.report-item.droplab-item-selected') + expect(container).not_to have_selector('.reopen-item') + end - it 'changes the button when an item is selected' do - button = container.find('.issuable-close-button') + it 'changes the button when an item is selected' do + button = container.find('.issuable-close-button') - container.find('.dropdown-toggle').click - container.find('.report-item').click + container.find('.dropdown-toggle').click + container.find('.report-item').click - expect(container).not_to have_selector('.dropdown-menu') - expect(button).to have_content('Report abuse') + expect(container).not_to have_selector('.dropdown-menu') + expect(button).to have_content('Report abuse') - container.find('.dropdown-toggle').click - container.find('.close-item').click + container.find('.dropdown-toggle').click + container.find('.close-item').click - expect(button).to have_content("Close #{human_model_name}") + expect(button).to have_content("Close #{human_model_name}") + end end -end - -describe 'Issuables Close/Reopen/Report toggle', :feature do - let(:user) { create(:user) } context 'on an issue' do let(:project) { create(:empty_project) } |