diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-01-25 22:35:56 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-01-25 22:35:56 +0800 |
commit | 7d26eddeceb485e0baa2913b01438ae70344b94f (patch) | |
tree | e5c250ef6403461b8895d47bf2a9e6cd020ad3ac /spec/models | |
parent | 3d4a7f63cbf197465fa556ece387b57f57176d10 (diff) | |
parent | 9df130ff2291849bc345494f78cb239fb300d59d (diff) | |
download | gitlab-ce-qa-secret-variables-scenario.tar.gz |
Merge remote-tracking branch 'upstream/master' into qa-secret-variables-scenarioqa-secret-variables-scenario
* upstream/master:
Make Gitaly RepositoryExists opt-out
Fix .batch_lfs_pointers accepting a lazy enumerator
Look at notes created just before merge when deciding if an MR can be reverted
Update missing paths
Default to HTTPS for all Gravatar URLs
Add note within ux documentation that further changes should be made within the design.gitlab project
Moves status icon into a vue file and adds tests Moves merging component into a vue file, adds i18n and better test cases
Prefer local variables instead
Add an test for QA::Runtime::RSAKey
Move initialize method later.
Also test if the fingerprint is correct
Generate ssh key on the fly for QA
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/merge_request_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index c76f32b3989..429b6615131 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -1127,9 +1127,19 @@ describe MergeRequest do end end - context 'when the revert commit is mentioned in a note before the MR was merged' do + context 'when the revert commit is mentioned in a note just before the MR was merged' do before do - subject.notes.last.update!(created_at: subject.metrics.merged_at - 1.second) + subject.notes.last.update!(created_at: subject.metrics.merged_at - 30.seconds) + end + + it 'returns false' do + expect(subject.can_be_reverted?(current_user)).to be_falsey + end + end + + context 'when the revert commit is mentioned in a note long before the MR was merged' do + before do + subject.notes.last.update!(created_at: subject.metrics.merged_at - 2.minutes) end it 'returns true' do |