summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorJeroen Jacobs <git@jeroenj.be>2016-02-12 21:41:31 +0100
committerJeroen Jacobs <git@jeroenj.be>2016-05-20 11:30:03 +0200
commit7880a300dc9ef3fcceb7f1a6af6a6500b0b46e5c (patch)
tree3aac27ae9ecedf438cd36356985ea4ca02c21153 /spec/models
parentf26389a02a48a53cccb3bb7dd1d7bcd4858c118d (diff)
downloadgitlab-ce-7880a300dc9ef3fcceb7f1a6af6a6500b0b46e5c.tar.gz
Allows MR authors to have the source branch removed when merging the MR
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/merge_request_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 9eef08c6d00..e269ff26a04 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -260,13 +260,18 @@ describe MergeRequest, models: true do
end
describe "#reset_merge_when_build_succeeds" do
- let(:merge_if_green) { create :merge_request, merge_when_build_succeeds: true, merge_user: create(:user) }
+ let(:merge_if_green) do
+ create :merge_request, merge_when_build_succeeds: true, merge_user: create(:user),
+ merge_params: { "should_remove_source_branch" => "1", "commit_message" => "msg" }
+ end
it "sets the item to false" do
merge_if_green.reset_merge_when_build_succeeds
merge_if_green.reload
expect(merge_if_green.merge_when_build_succeeds).to be_falsey
+ expect(merge_if_green.merge_params["should_remove_source_branch"]).to be_nil
+ expect(merge_if_green.merge_params["commit_message"]).to be_nil
end
end