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:
authorRyan Scott <ryan@ryan-scott.me>2017-03-30 04:39:06 +0300
committerSean McGivern <sean@gitlab.com>2017-07-20 17:33:24 +0300
commit01c9488f4a559063eba77074ba2d369de87b8018 (patch)
treeffd18d3ebd174cf47ab9eb71cbacd940d4cf2831 /spec/services/system_note_service_spec.rb
parentb6555693a8e445405c5746b7c76c9f603395bba2 (diff)
Added slash command to close an issue as a duplicate. Closes #26372
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r--spec/services/system_note_service_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index 60477b8e9ba..db120889119 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -1101,4 +1101,29 @@ describe SystemNoteService, services: true do
expect(subject.note).to include(diffs_project_merge_request_url(project, merge_request, diff_id: diff_id, anchor: line_code))
end
end
+
+ describe '.mark_duplicate_issue' do
+ subject { described_class.mark_duplicate_issue(noteable, project, author, original_issue) }
+
+ context 'within the same project' do
+ let(:original_issue) { create(:issue, project: project) }
+
+ it_behaves_like 'a system note' do
+ let(:action) { 'duplicate' }
+ end
+
+ it { expect(subject.note).to eq "marked this issue as a duplicate of #{original_issue.to_reference}" }
+ end
+
+ context 'across different projects' do
+ let(:other_project) { create(:empty_project) }
+ let(:original_issue) { create(:issue, project: other_project) }
+
+ it_behaves_like 'a system note' do
+ let(:action) { 'duplicate' }
+ end
+
+ it { expect(subject.note).to eq "marked this issue as a duplicate of #{original_issue.to_reference(project)}" }
+ end
+ end
end