diff options
author | Stan Hu <stanhu@gmail.com> | 2017-06-21 09:43:58 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-06-21 09:43:58 -0700 |
commit | 0f943c941bf0c7abc0358598f4a323b031bcca80 (patch) | |
tree | 7dd8ea3484252d469368498846c2c2b7f7500af4 /spec/support/features/reportable_note_shared_examples.rb | |
parent | 74fbc694de9a9cfe8a048c3c8d937f8e7068ce21 (diff) | |
parent | 043f8c260f49bb14f1c40ec563179c12c3df7828 (diff) | |
download | gitlab-ce-0f943c941bf0c7abc0358598f4a323b031bcca80.tar.gz |
Merge branch 'master' into sh-headless-chrome-support
Diffstat (limited to 'spec/support/features/reportable_note_shared_examples.rb')
-rw-r--r-- | spec/support/features/reportable_note_shared_examples.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/support/features/reportable_note_shared_examples.rb b/spec/support/features/reportable_note_shared_examples.rb index 0d80c95e826..27e079c01dd 100644 --- a/spec/support/features/reportable_note_shared_examples.rb +++ b/spec/support/features/reportable_note_shared_examples.rb @@ -13,9 +13,7 @@ shared_examples 'reportable note' do it 'dropdown has Edit, Report and Delete links' do dropdown = comment.find(more_actions_selector) - - dropdown.click - dropdown.find('.dropdown-menu li', match: :first) + open_dropdown(dropdown) expect(dropdown).to have_button('Edit comment') expect(dropdown).to have_link('Report as abuse', href: abuse_report_path) @@ -24,13 +22,16 @@ shared_examples 'reportable note' do it 'Report button links to a report page' do dropdown = comment.find(more_actions_selector) - - dropdown.click - dropdown.find('.dropdown-menu li', match: :first) + open_dropdown(dropdown) dropdown.click_link('Report as abuse') expect(find('#user_name')['value']).to match(note.author.username) expect(find('#abuse_report_message')['value']).to match(noteable_note_url(note)) end + + def open_dropdown(dropdown) + dropdown.click + dropdown.find('.dropdown-menu li', match: :first) + end end |