Commit 5f00c459 authored by Kerri Miller's avatar Kerri Miller

Remove WIP usage in related specs

parent ad67e7e1
...@@ -443,7 +443,7 @@ RSpec.describe Projects::MergeRequestsController do ...@@ -443,7 +443,7 @@ RSpec.describe Projects::MergeRequestsController do
context 'when the merge request is not mergeable' do context 'when the merge request is not mergeable' do
before do before do
merge_request.update!(title: "WIP: #{merge_request.title}") merge_request.update!(title: "Draft: #{merge_request.title}")
post :merge, params: base_params post :merge, params: base_params
end end
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Merge request > User resolves Work in Progress', :js do RSpec.describe 'Merge request > User resolves Draft', :js do
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
let(:user) { project.creator } let(:user) { project.creator }
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, source_project: project, create(:merge_request_with_diffs, source_project: project,
author: user, author: user,
title: 'WIP: Bug NS-04', title: 'Draft: Bug NS-04',
merge_params: { force_remove_source_branch: '1' }) merge_params: { force_remove_source_branch: '1' })
end end
......
...@@ -61,19 +61,19 @@ RSpec.describe MergeRequests::CreateService, :clean_gitlab_redis_shared_state do ...@@ -61,19 +61,19 @@ RSpec.describe MergeRequests::CreateService, :clean_gitlab_redis_shared_state do
expect(merge_request.reload).to be_preparing expect(merge_request.reload).to be_preparing
end end
describe 'when marked with /wip' do describe 'when marked with /draft' do
context 'in title and in description' do context 'in title and in description' do
let(:opts) do let(:opts) do
{ {
title: 'WIP: Awesome merge_request', title: 'Draft: Awesome merge_request',
description: "well this is not done yet\n/wip", description: "well this is not done yet\n/draft",
source_branch: 'feature', source_branch: 'feature',
target_branch: 'master', target_branch: 'master',
assignees: [user2] assignees: [user2]
} }
end end
it 'sets MR to WIP' do it 'sets MR to draft' do
expect(merge_request.work_in_progress?).to be(true) expect(merge_request.work_in_progress?).to be(true)
end end
end end
...@@ -89,7 +89,7 @@ RSpec.describe MergeRequests::CreateService, :clean_gitlab_redis_shared_state do ...@@ -89,7 +89,7 @@ RSpec.describe MergeRequests::CreateService, :clean_gitlab_redis_shared_state do
} }
end end
it 'sets MR to WIP' do it 'sets MR to draft' do
expect(merge_request.work_in_progress?).to be(true) expect(merge_request.work_in_progress?).to be(true)
end end
end end
......
...@@ -102,16 +102,16 @@ RSpec.describe MergeRequests::UpdateService, :mailer do ...@@ -102,16 +102,16 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
MergeRequests::UpdateService.new(project: project, current_user: user, params: opts).execute(merge_request2) MergeRequests::UpdateService.new(project: project, current_user: user, params: opts).execute(merge_request2)
end end
it 'tracks Draft/WIP marking' do it 'tracks Draft marking' do
expect(Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter) expect(Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter)
.to receive(:track_marked_as_draft_action).once.with(user: user) .to receive(:track_marked_as_draft_action).once.with(user: user)
opts[:title] = "WIP: #{opts[:title]}" opts[:title] = "Draft: #{opts[:title]}"
MergeRequests::UpdateService.new(project: project, current_user: user, params: opts).execute(merge_request2) MergeRequests::UpdateService.new(project: project, current_user: user, params: opts).execute(merge_request2)
end end
it 'tracks Draft/WIP un-marking' do it 'tracks Draft un-marking' do
expect(Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter) expect(Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter)
.to receive(:track_unmarked_as_draft_action).once.with(user: user) .to receive(:track_unmarked_as_draft_action).once.with(user: user)
......
...@@ -325,11 +325,11 @@ RSpec.describe Notes::CreateService do ...@@ -325,11 +325,11 @@ RSpec.describe Notes::CreateService do
expect(issuable.work_in_progress?).to eq(can_use_quick_action) expect(issuable.work_in_progress?).to eq(can_use_quick_action)
} }
), ),
# Remove WIP status # Remove draft status
QuickAction.new( QuickAction.new(
action_text: "/draft", action_text: "/draft",
before_action: -> { before_action: -> {
issuable.reload.update!(title: "WIP: title") issuable.reload.update!(title: "Draft: title")
}, },
expectation: ->(noteable, can_use_quick_action) { expectation: ->(noteable, can_use_quick_action) {
expect(noteable.work_in_progress?).not_to eq(can_use_quick_action) expect(noteable.work_in_progress?).not_to eq(can_use_quick_action)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment