diff options
Diffstat (limited to 'spec/models/commit_collection_spec.rb')
-rw-r--r-- | spec/models/commit_collection_spec.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/spec/models/commit_collection_spec.rb b/spec/models/commit_collection_spec.rb index 1d2d89573bb..be80aced3fd 100644 --- a/spec/models/commit_collection_spec.rb +++ b/spec/models/commit_collection_spec.rb @@ -27,11 +27,23 @@ RSpec.describe CommitCollection, feature_category: :source_code_management do expect(collection.committers).to be_empty end - it 'excludes authors of merge commits' do - commit = project.commit("60ecb67744cb56576c30214ff52294f8ce2def98") - create(:user, email: commit.committer_email.upcase) + context 'when is with_merge_commits false' do + it 'excludes authors of merge commits' do + commit = project.commit("60ecb67744cb56576c30214ff52294f8ce2def98") + create(:user, email: commit.committer_email.upcase) - expect(collection.committers).to be_empty + expect(collection.committers).to be_empty + end + end + + context 'when is with_merge_commits true' do + let(:commit) { project.commit("60ecb67744cb56576c30214ff52294f8ce2def98") } + + it 'does not exclude authors of merge commits' do + user = create(:user, email: commit.committer_email.upcase) + + expect(collection.committers(with_merge_commits: true)).to contain_exactly(user) + end end context 'when committer email is nil' do |