diff options
author | Robert Speicher <robert@gitlab.com> | 2018-05-08 01:17:55 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-05-08 01:17:55 +0300 |
commit | b69ade5dd1eca99bff388240a184b6a579196f9d (patch) | |
tree | bc568a5af275a74d29c92235a9695f47aca13378 /spec/models | |
parent | 4ac42e48344d4971913e8ed4afca27d0bdf07929 (diff) | |
parent | 3063225ca289e87c3f590e1722451a1c674e2ac9 (diff) |
Merge branch '43557-osw-present-merge-sha-commit' into 'master'
Resolve "Display merge commit SHA in merge widget after merge"
Closes #43557
See merge request gitlab-org/gitlab-ce!18722
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/merge_request_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 5a9aa7c7d1b..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 |