summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-10-14 20:10:34 +0000
committerRobert Speicher <robert@gitlab.com>2015-10-14 20:10:34 +0000
commit123669a55107514798ba531ba3a744b3ec8503ee (patch)
treed44c8f0dbd7f0426341392c755af60d023a3d808 /spec/support
parenta3a80eac110fb9f195eaccd3afd8e8611d1924dc (diff)
parent276b3a7bc202bd9b51c8f5401f4c525227f3a4d8 (diff)
downloadgitlab-ce-123669a55107514798ba531ba3a744b3ec8503ee.tar.gz
Merge branch 'simplify-cross-references' into 'master'
Simplify code around (cross)-references See merge request !1568
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/mentionable_shared_examples.rb15
1 files changed, 4 insertions, 11 deletions
diff --git a/spec/support/mentionable_shared_examples.rb b/spec/support/mentionable_shared_examples.rb
index e3de0afb448..f584904845e 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) }
@@ -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,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
@@ -143,6 +136,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