Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-27 13:03:14 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-27 13:03:14 +0300
commit701c2e9a3b4b60642eba0ee00c3e11e1e43fb131 (patch)
treec5bca23181bc9320cab36619b2287f1cc405623d /spec/services
parent3ed05b2191a7ede4734e2b7952f3810e5a1ee728 (diff)
parent3cb6a338466ca9b8e2a831cce306fc6d650231ed (diff)
Merge branch 'rs-to_reference' into 'master'
Add to_reference method to referable models Now there is a single source of information for which attribute a model uses to be referenced, and its special character. See merge request !641
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/system_note_service_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index 6d8c71f94f9..0dcc94e8bd4 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -259,13 +259,13 @@ describe SystemNoteService do
let(:mentioner) { project2.repository.commit }
it 'references the mentioning commit' do
- expect(subject.note).to eq "mentioned in commit #{project2.path_with_namespace}@#{mentioner.id}"
+ expect(subject.note).to eq "mentioned in commit #{mentioner.to_reference(project)}"
end
end
context 'from non-Commit' do
it 'references the mentioning object' do
- expect(subject.note).to eq "mentioned in issue #{project2.path_with_namespace}##{mentioner.iid}"
+ expect(subject.note).to eq "mentioned in issue #{mentioner.to_reference(project)}"
end
end
end
@@ -275,13 +275,13 @@ describe SystemNoteService do
let(:mentioner) { project.repository.commit }
it 'references the mentioning commit' do
- expect(subject.note).to eq "mentioned in commit #{mentioner.id}"
+ expect(subject.note).to eq "mentioned in commit #{mentioner.to_reference}"
end
end
context 'from non-Commit' do
it 'references the mentioning object' do
- expect(subject.note).to eq "mentioned in issue ##{mentioner.iid}"
+ expect(subject.note).to eq "mentioned in issue #{mentioner.to_reference}"
end
end
end
@@ -291,7 +291,7 @@ describe SystemNoteService do
describe '.cross_reference?' do
it 'is truthy when text begins with expected text' do
- expect(described_class.cross_reference?('mentioned in issue #1')).to be_truthy
+ expect(described_class.cross_reference?('mentioned in something')).to be_truthy
end
it 'is falsey when text does not begin with expected text' do