summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-11-03 15:15:03 +0100
committerRémy Coutable <remy@rymai.me>2016-11-03 18:29:00 +0100
commit46689162a3902ab294341b5860f16947ed030170 (patch)
treeaa7f74a8630ae5b5e7f6962fcdb5c0fcabbdb07e /spec/features
parent651bdd7c34c9ebf686b8357d8fc3ca4d0a58792e (diff)
downloadgitlab-ce-46689162a3902ab294341b5860f16947ed030170.tar.gz
Ensure merge request's "remove branch" accessors return booleans24102-cannot-unselect-remove-source-branch-when-editing-merge-request
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/merge_requests/edit_mr_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/features/merge_requests/edit_mr_spec.rb b/spec/features/merge_requests/edit_mr_spec.rb
index c77e719c5df..c46bd8d449f 100644
--- a/spec/features/merge_requests/edit_mr_spec.rb
+++ b/spec/features/merge_requests/edit_mr_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Edit Merge Request', feature: true do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
- let(:merge_request) { create(:merge_request, :with_diffs, source_project: project) }
+ let(:merge_request) { create(:merge_request, :simple, source_project: project) }
before do
project.team << [user, :master]
@@ -28,5 +28,17 @@ feature 'Edit Merge Request', feature: true do
expect(page).to have_content 'Someone edited the merge request the same time you did'
end
+
+ it 'allows to unselect "Remove source branch"' do
+ merge_request.update(merge_params: { 'force_remove_source_branch' => '1' })
+ expect(merge_request.merge_params['force_remove_source_branch']).to be_truthy
+
+ visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
+ uncheck 'Remove source branch when merge request is accepted'
+
+ click_button 'Save changes'
+
+ expect(page).to have_content 'Remove source branch'
+ end
end
end