diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-08 23:33:12 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-08 23:33:12 +0300 |
commit | c92f1d893cc5f114ec1e00251b3d1dcec78fab28 (patch) | |
tree | 8935a699fba25feb3ce0672acacf89c4e7836e2e /spec/models/merge_request_spec.rb | |
parent | 4babf79aa1e8e2ec315f31fba0d3646825322d91 (diff) | |
parent | d122279fb0a28f248e6cdba339cb1bcd96a91477 (diff) |
Merge branch '10-8-stable-prepare-rc4' into '10-8-stable'
Prepare 10.8 RC4 release
See merge request gitlab-org/gitlab-ce!18784
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r-- | spec/models/merge_request_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index becb146422e..04379e7d2c3 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -1069,6 +1069,22 @@ describe MergeRequest do end end + describe '#short_merge_commit_sha' do + let(:merge_request) { build_stubbed(:merge_request) } + + it 'returns short id when there is a merge_commit_sha' do + merge_request.merge_commit_sha = 'f7ce827c314c9340b075657fd61c789fb01cf74d' + + expect(merge_request.short_merge_commit_sha).to eq('f7ce827c') + end + + it 'returns nil when there is no merge_commit_sha' do + merge_request.merge_commit_sha = nil + + expect(merge_request.short_merge_commit_sha).to be_nil + end + end + describe '#can_be_reverted?' do context 'when there is no merge_commit for the MR' do before do @@ -1213,7 +1229,7 @@ describe MergeRequest do it 'enqueues MergeWorker job and updates merge_jid' do merge_request = create(:merge_request) user_id = double(:user_id) - params = double(:params) + params = {} merge_jid = 'hash-123' expect(MergeWorker).to receive(:perform_async).with(merge_request.id, user_id, params) do |