diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-15 12:26:58 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-15 12:26:58 +0300 |
commit | 95f0440a7823a927ebba1557b091c12255e49ac4 (patch) | |
tree | fa6d130f2baff18e7a70d74dafe79e20da35babe /spec/support/mentionable_shared_examples.rb | |
parent | 4a5b77188ec7525d1c3a1ee925c8791f841b040c (diff) | |
parent | 123669a55107514798ba531ba3a744b3ec8503ee (diff) |
Merge branch 'master' into rs-redactor-filter
Diffstat (limited to 'spec/support/mentionable_shared_examples.rb')
-rw-r--r-- | spec/support/mentionable_shared_examples.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/spec/support/mentionable_shared_examples.rb b/spec/support/mentionable_shared_examples.rb index 2b52b4c9b10..3bb568f4d49 100644 --- a/spec/support/mentionable_shared_examples.rb +++ b/spec/support/mentionable_shared_examples.rb @@ -5,7 +5,7 @@ # - let(:set_mentionable_text) { lambda { |txt| "block that assigns txt to the subject's mentionable_text" } } def common_mentionable_setup - let(:project) { create :project } + let(:project) { subject.project } let(:author) { subject.author } let(:mentioned_issue) { create(:issue, project: project) } @@ -67,7 +67,7 @@ shared_examples 'a mentionable' do it "extracts references from its reference property" do # De-duplicate and omit itself - refs = subject.references(project) + refs = subject.referenced_mentionables expect(refs.size).to eq(6) expect(refs).to include(mentioned_issue) expect(refs).to include(mentioned_mr) @@ -86,14 +86,7 @@ shared_examples 'a mentionable' do with(referenced, subject.local_reference, author) end - subject.create_cross_references!(project, author) - end - - it 'detects existing cross-references' do - SystemNoteService.cross_reference(mentioned_issue, subject.local_reference, author) - - expect(subject).to have_mentioned(mentioned_issue) - expect(subject).not_to have_mentioned(mentioned_mr) + subject.create_cross_references! end end @@ -145,6 +138,6 @@ shared_examples 'an editable mentionable' do end set_mentionable_text.call(new_text) - subject.create_new_cross_references!(project, author) + subject.create_new_cross_references!(author) end end |