diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-06-20 19:04:46 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-06-20 19:04:46 +0300 |
commit | d9d020b169eb2c3b57f52d423fb5e8c6e907dd9f (patch) | |
tree | 5c5194db631e7477921b400980da51ed63b476ee /spec/support | |
parent | 207a53ce9826bbe0ffbe0712b67564fbd10b7015 (diff) | |
parent | 1f9fb9e45738995ab8935d2e71ca7df73c3fe23c (diff) |
Merge branch 'hide-edit-comment-and-report-as-abuse-conditionally' into 'master'
Only show 'Edit comment'/'Report as abuse' when user has perms/isnt current_user
See merge request !12096
Diffstat (limited to 'spec/support')
-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 |