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
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-02-16 14:47:46 +0300
committerDouwe Maan <douwe@gitlab.com>2016-02-16 14:47:46 +0300
commit42d088fcb1e59a5789908dce8b141271bed3940a (patch)
tree96927930e4079fde5364517e145ca871a6b66423 /spec
parent8db62f25480562e8497c3fb6d9f4611fc5902d94 (diff)
parent11913a762a3ed6514594e6ac6ffe1717dd362ae1 (diff)
Merge branch 'fix/cross-reference-notes-forks' into 'master'
Fix cross reference notes on forks Updates `cross_reference_exists?` to match on commit only. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/5849 See merge request !2731
Diffstat (limited to 'spec')
-rw-r--r--spec/services/system_note_service_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index d3364a71022..1bdc03af12d 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -424,6 +424,21 @@ describe SystemNoteService, services: true do
to be_falsey
end
end
+
+ context 'commit with cross-reference from fork' do
+ let(:author2) { create(:user) }
+ let(:forked_project) { Projects::ForkService.new(project, author2).execute }
+ let(:commit2) { forked_project.commit }
+
+ before do
+ described_class.cross_reference(noteable, commit0, author2)
+ end
+
+ it 'is true when a fork mentions an external issue' do
+ expect(described_class.cross_reference_exists?(noteable, commit2)).
+ to be true
+ end
+ end
end
include JiraServiceHelper