diff options
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r-- | spec/models/merge_request_spec.rb | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 42c49e330cc..c3f87edb0c6 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -454,7 +454,6 @@ describe MergeRequest do it 'does not cache issues from external trackers' do issue = ExternalIssue.new('JIRA-123', subject.project) commit = double('commit1', safe_message: "Fixes #{issue.to_reference}") - allow(subject).to receive(:commits).and_return([commit]) expect { subject.cache_merge_request_closes_issues!(subject.author) }.not_to raise_error @@ -1043,31 +1042,17 @@ describe MergeRequest do end end - describe '#commit_authors' do - it 'returns all the authors of every commit in the merge request' do - users = subject.commits.map(&:author_email).uniq.map do |email| - create(:user, email: email) - end - - expect(subject.commit_authors).to match_array(users) - end - - it 'returns an empty array if no author is associated with a user' do - expect(subject.commit_authors).to be_empty - end - end - - describe '#authors' do - it 'returns a list with all the commit authors in the merge request and author' do - users = subject.commits.map(&:author_email).uniq.map do |email| + describe '#committers' do + it 'returns all the committers of every commit in the merge request' do + users = subject.commits.map(&:committer_email).uniq.map do |email| create(:user, email: email) end - expect(subject.authors).to match_array([subject.author, *users]) + expect(subject.committers).to match_array(users) end - it 'returns only the author if no committer is associated with a user' do - expect(subject.authors).to contain_exactly(subject.author) + it 'returns an empty array if no committer is associated with a user' do + expect(subject.committers).to be_empty end end |