diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-12 12:54:46 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-12 12:54:46 +0300 |
commit | b0164771ec693ff58504ece560371ffec11f9ca9 (patch) | |
tree | 3668a45479d72788bf8c2ed9390992bfa74f1c76 /spec/support/mentionable_shared_examples.rb | |
parent | 03b7fe71a5c5372fc8239a26e757685ab12eed87 (diff) |
Simplify code around (cross)-references
Diffstat (limited to 'spec/support/mentionable_shared_examples.rb')
-rw-r--r-- | spec/support/mentionable_shared_examples.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/support/mentionable_shared_examples.rb b/spec/support/mentionable_shared_examples.rb index e3de0afb448..220566a22b6 100644 --- a/spec/support/mentionable_shared_examples.rb +++ b/spec/support/mentionable_shared_examples.rb @@ -65,7 +65,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) @@ -84,14 +84,14 @@ shared_examples 'a mentionable' do with(referenced, subject.local_reference, author) end - subject.create_cross_references!(project, author) + subject.create_cross_references! 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) + expect(subject.cross_reference_exists?(mentioned_issue)).to be_truthy + expect(subject.cross_reference_exists?(mentioned_mr)).to be_falsey end end @@ -143,6 +143,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 |