diff options
author | Rémy Coutable <remy@rymai.me> | 2018-06-20 13:00:32 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-06-20 13:00:32 +0300 |
commit | a88a9e22c5f27b458593d08ee9dce5a834c51f2a (patch) | |
tree | d21eec9ccf0127d9e9b4efd2ff0abccdac9ff841 | |
parent | 52b9cead80a51fcf6d293f2b3cd29f23e5e71a2d (diff) | |
parent | 9214e273a8759cbcd21ea1ef62fd9d594cec1e1d (diff) |
Merge branch 'rails5-fix-48104' into 'master'
Rails5 fix expected: 1 time with arguments: (97, anything, {"squash"=>false}) received: 0 times
Closes #48104
See merge request gitlab-org/gitlab-ce!20004
-rw-r--r-- | changelogs/unreleased/rails5-fix-48104.yml | 6 | ||||
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/changelogs/unreleased/rails5-fix-48104.yml b/changelogs/unreleased/rails5-fix-48104.yml new file mode 100644 index 00000000000..6cf519ad791 --- /dev/null +++ b/changelogs/unreleased/rails5-fix-48104.yml @@ -0,0 +1,6 @@ +--- +title: 'Rails5 fix expected: 1 time with arguments: (97, anything, {"squash"=>false}) + received: 0 times' +merge_request: 20004 +author: Jasper Maes +type: fixed diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index a412e74581d..7f5f0b76c51 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -337,7 +337,12 @@ describe Projects::MergeRequestsController do context 'when the sha parameter matches the source SHA' do def merge_with_sha(params = {}) - post :merge, base_params.merge(sha: merge_request.diff_head_sha).merge(params) + post_params = base_params.merge(sha: merge_request.diff_head_sha).merge(params) + if Gitlab.rails5? + post :merge, params: post_params, as: :json + else + post :merge, post_params + end end it 'returns :success' do |