summaryrefslogtreecommitdiff
path: root/spec/models/merge_request_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r--spec/models/merge_request_spec.rb27
1 files changed, 6 insertions, 21 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 5adeb616e84..94825af42c7 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -474,7 +474,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
@@ -1063,31 +1062,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.without_merge_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.without_merge_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.without_merge_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