Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-06-24 20:03:40 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-06-24 23:54:24 +0300
commit7232392c763a024296e1971134ebe2b5ef982e61 (patch)
tree3e96a19b6a8bca21cc5f313ca4202971c9f686f9 /spec
parent350f857e11e801725e5a8b5d9e6b5f6460c729e8 (diff)
Merge branch '19035-fix-merge-issue' into 'master'
Fix a wrong MR status when merge_when_build_succeeds & project.only_allow_merge_if_build_succeeds are true ## What does this MR do? Fix a wrong MR status when merge_when_build_succeeds & project.only_allow_merge_if_build_succeeds are true. ## Are there points in the code the reviewer needs to double check? @stanhu I reused your proposal from the issue, I think it's a good enough solution. ## What are the relevant issue numbers? Fixes #19035. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4912
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects/merge_requests_controller_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb
index 4b408c03703..5e66106122c 100644
--- a/spec/controllers/projects/merge_requests_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests_controller_spec.rb
@@ -264,6 +264,18 @@ describe Projects::MergeRequestsController do
merge_when_build_succeeds
end
+
+ context 'when project.only_allow_merge_if_build_succeeds? is true' do
+ before do
+ project.update_column(:only_allow_merge_if_build_succeeds, true)
+ end
+
+ it 'returns :merge_when_build_succeeds' do
+ merge_when_build_succeeds
+
+ expect(assigns(:status)).to eq(:merge_when_build_succeeds)
+ end
+ end
end
end
end