summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-04-09 08:20:28 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-04-09 08:20:28 +0000
commitd4cfb7301b5478da3bd4b89c54bfc6d3683d0050 (patch)
treeb1bf103144b3088eebc5cfcfc803821e08aebf04 /spec
parentfeb149f864d1ecbf5ffb5ba59f538640576c367c (diff)
parent47b1528abe69f9b584536a3557f23d912b0ecfd8 (diff)
downloadgitlab-ce-d4cfb7301b5478da3bd4b89c54bfc6d3683d0050.tar.gz
Merge branch 'sh-fix-issue-45152' into 'master'
Fix undefined method `one?` when pushing to an existing merge request Closes #45152 See merge request gitlab-org/gitlab-ce!18243
Diffstat (limited to 'spec')
-rw-r--r--spec/mailers/notify_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 971a88e9ee9..43e419cd7de 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -390,11 +390,11 @@ describe Notify do
end
end
- describe 'that have new commits' do
+ shared_examples 'a push to an existing merge request' do
let(:push_user) { create(:user) }
subject do
- described_class.push_to_merge_request_email(recipient.id, merge_request.id, push_user.id, new_commits: merge_request.commits)
+ described_class.push_to_merge_request_email(recipient.id, merge_request.id, push_user.id, new_commits: merge_request.commits, existing_commits: existing_commits)
end
it_behaves_like 'a multiple recipients email'
@@ -419,6 +419,18 @@ describe Notify do
end
end
end
+
+ describe 'that have new commits' do
+ let(:existing_commits) { [] }
+
+ it_behaves_like 'a push to an existing merge request'
+ end
+
+ describe 'that have new commits on top of an existing one' do
+ let(:existing_commits) { [merge_request.commits.first] }
+
+ it_behaves_like 'a push to an existing merge request'
+ end
end
context 'for issue notes' do