summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-06-20 09:03:04 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-06-20 09:03:04 +0100
commit1f9fb9e45738995ab8935d2e71ca7df73c3fe23c (patch)
treec56f2ac23ad048aa374754a5de1f2ce051b5788b
parentf50a8065313b9cdc414aff157fcbfbdbfccd5a70 (diff)
downloadgitlab-ce-hide-edit-comment-and-report-as-abuse-conditionally.tar.gz
Remove PersonalSnippet case for reportable_note specshide-edit-comment-and-report-as-abuse-conditionally
-rw-r--r--spec/features/reportable_note/snippets_spec.rb12
-rw-r--r--spec/support/features/reportable_note_shared_examples.rb36
2 files changed, 8 insertions, 40 deletions
diff --git a/spec/features/reportable_note/snippets_spec.rb b/spec/features/reportable_note/snippets_spec.rb
index 94cadaa8feb..f761371323f 100644
--- a/spec/features/reportable_note/snippets_spec.rb
+++ b/spec/features/reportable_note/snippets_spec.rb
@@ -19,16 +19,4 @@ describe 'Reportable note on snippets', :feature, :js do
it_behaves_like 'reportable note'
end
-
- describe 'on personal snippet' do
- let(:snippet) { create(:personal_snippet, :public, author: user) }
- let!(:note) { create(:note_on_personal_snippet, noteable: snippet) }
- let!(:owners_note) { create(:note_on_personal_snippet, noteable: snippet, author: user) }
-
- before do
- visit snippet_path(snippet)
- end
-
- it_behaves_like 'reportable note', true
- end
end
diff --git a/spec/support/features/reportable_note_shared_examples.rb b/spec/support/features/reportable_note_shared_examples.rb
index 560935704f7..27e079c01dd 100644
--- a/spec/support/features/reportable_note_shared_examples.rb
+++ b/spec/support/features/reportable_note_shared_examples.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-shared_examples 'reportable note' do |is_a_personal_snippet|
+shared_examples 'reportable note' do
include NotesHelper
let(:comment) { find("##{ActionView::RecordIdentifier.dom_id(note)}") }
@@ -11,33 +11,13 @@ shared_examples 'reportable note' do |is_a_personal_snippet|
expect(comment).to have_selector(more_actions_selector)
end
- if is_a_personal_snippet
- it 'dropdown has Report link on other users comment' do
- dropdown = comment.find(more_actions_selector)
- open_dropdown(dropdown)
-
- expect(dropdown).to have_link('Report as abuse', href: abuse_report_path)
- end
-
- it 'dropdown has Edit and Delete links on the owners comment' do
- find('#notes-list .note', match: :first)
- other_comment = all('#notes-list .note').last
-
- dropdown = other_comment.find(more_actions_selector)
- open_dropdown(dropdown)
-
- expect(dropdown).to have_button('Edit comment')
- expect(dropdown).to have_link('Delete comment', href: note_url(owners_note, project))
- end
- else
- it 'dropdown has Edit, Report and Delete links' do
- dropdown = comment.find(more_actions_selector)
- open_dropdown(dropdown)
-
- expect(dropdown).to have_button('Edit comment')
- expect(dropdown).to have_link('Report as abuse', href: abuse_report_path)
- expect(dropdown).to have_link('Delete comment', href: note_url(note, project))
- end
+ it 'dropdown has Edit, Report and Delete links' do
+ dropdown = comment.find(more_actions_selector)
+ open_dropdown(dropdown)
+
+ expect(dropdown).to have_button('Edit comment')
+ expect(dropdown).to have_link('Report as abuse', href: abuse_report_path)
+ expect(dropdown).to have_link('Delete comment', href: note_url(note, project))
end
it 'Report button links to a report page' do