diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/services/quick_actions | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r-- | spec/services/quick_actions/interpret_service_spec.rb | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index 6f3814095f9..1f521ed4a93 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -312,8 +312,8 @@ RSpec.describe QuickActions::InterpretService do end end - shared_examples 'wip command' do - it 'returns wip_event: "wip" if content contains /wip' do + shared_examples 'draft command' do + it 'returns wip_event: "wip" if content contains /draft' do _, updates, _ = service.execute(content, issuable) expect(updates).to eq(wip_event: 'wip') @@ -322,12 +322,12 @@ RSpec.describe QuickActions::InterpretService do it 'returns the wip message' do _, _, message = service.execute(content, issuable) - expect(message).to eq("Marked this #{issuable.to_ability_name.humanize(capitalize: false)} as Work In Progress.") + expect(message).to eq("Marked this #{issuable.to_ability_name.humanize(capitalize: false)} as a draft.") end end - shared_examples 'unwip command' do - it 'returns wip_event: "unwip" if content contains /wip' do + shared_examples 'undraft command' do + it 'returns wip_event: "unwip" if content contains /draft' do issuable.update!(title: issuable.wip_title) _, updates, _ = service.execute(content, issuable) @@ -338,7 +338,7 @@ RSpec.describe QuickActions::InterpretService do issuable.update!(title: issuable.wip_title) _, _, message = service.execute(content, issuable) - expect(message).to eq("Unmarked this #{issuable.to_ability_name.humanize(capitalize: false)} as Work In Progress.") + expect(message).to eq("Unmarked this #{issuable.to_ability_name.humanize(capitalize: false)} as a draft.") end end @@ -1026,16 +1026,26 @@ RSpec.describe QuickActions::InterpretService do let(:issuable) { issue } end - it_behaves_like 'wip command' do + it_behaves_like 'draft command' do let(:content) { '/wip' } let(:issuable) { merge_request } end - it_behaves_like 'unwip command' do + it_behaves_like 'undraft command' do let(:content) { '/wip' } let(:issuable) { merge_request } end + it_behaves_like 'draft command' do + let(:content) { '/draft' } + let(:issuable) { merge_request } + end + + it_behaves_like 'undraft command' do + let(:content) { '/draft' } + let(:issuable) { merge_request } + end + it_behaves_like 'empty command' do let(:content) { '/remove_due_date' } let(:issuable) { merge_request } @@ -1896,13 +1906,13 @@ RSpec.describe QuickActions::InterpretService do end end - describe 'wip command' do - let(:content) { '/wip' } + describe 'draft command' do + let(:content) { '/draft' } it 'includes the new status' do _, explanations = service.explain(content, merge_request) - expect(explanations).to eq(['Marks this merge request as Work In Progress.']) + expect(explanations).to eq(['Marks this merge request as a draft.']) end end |