diff options
author | Sean McGivern <sean@gitlab.com> | 2018-04-20 10:28:17 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-04-24 15:12:59 +0300 |
commit | db3774376aafbdea8db6840c88bd6d875cb9bac3 (patch) | |
tree | 7f70cce162e8027308ce12730562113ed51de624 /spec/services/quick_actions | |
parent | 78aebc49491ee18f76fa3c34a3a4e40e5d3b9421 (diff) |
Make /copy_metadata only handle the first issuable passed
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r-- | spec/services/quick_actions/interpret_service_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index 4aad2aaef79..bd835a1fca6 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -775,8 +775,8 @@ describe QuickActions::InterpretService do end context '/copy_metadata command' do - let!(:todo_label) { create(:label, project: project, title: 'To Do') } - let!(:inreview_label) { create(:label, project: project, title: 'In Review') } + let(:todo_label) { create(:label, project: project, title: 'To Do') } + let(:inreview_label) { create(:label, project: project, title: 'In Review') } it_behaves_like 'empty command' do let(:content) { '/copy_metadata' } @@ -799,6 +799,17 @@ describe QuickActions::InterpretService do end end + context 'when more than one issuable is passed' do + it_behaves_like 'copy_metadata command' do + let(:source_issuable) { create(:labeled_issue, project: project, labels: [inreview_label, todo_label]) } + let(:other_label) { create(:label, project: project, title: 'Other') } + let(:other_source_issuable) { create(:labeled_issue, project: project, labels: [other_label]) } + + let(:content) { "/copy_metadata #{source_issuable.to_reference} #{other_source_issuable.to_reference}" } + let(:issuable) { issue } + end + end + context 'cross project references' do it_behaves_like 'empty command' do let(:other_project) { create(:project, :public) } |