diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-23 21:33:55 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-23 21:33:55 +0300 |
commit | 9ad2dba250e3facc18ff2f21217ebe006451dd8c (patch) | |
tree | b609952bf3317067891f0189ef81441fe5cc381a /spec/lib/gitlab/identifier_spec.rb | |
parent | 7100b76923fc88667b1bd22b34f0a43323fe84b0 (diff) |
Use Commit#author so we share logic and cache
Closes #24900
Diffstat (limited to 'spec/lib/gitlab/identifier_spec.rb')
-rw-r--r-- | spec/lib/gitlab/identifier_spec.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/lib/gitlab/identifier_spec.rb b/spec/lib/gitlab/identifier_spec.rb index f42c4453dd1..bb758a8a202 100644 --- a/spec/lib/gitlab/identifier_spec.rb +++ b/spec/lib/gitlab/identifier_spec.rb @@ -40,7 +40,7 @@ describe Gitlab::Identifier do describe '#identify_using_commit' do it "returns the User for an existing commit author's Email address" do - commit = double(:commit, author_email: user.email) + commit = double(:commit, author: user, author_email: user.email) expect(project).to receive(:commit).with('123').and_return(commit) @@ -62,10 +62,9 @@ describe Gitlab::Identifier do end it 'caches the found users per Email' do - commit = double(:commit, author_email: user.email) + commit = double(:commit, author: user, author_email: user.email) expect(project).to receive(:commit).with('123').twice.and_return(commit) - expect(User).to receive(:find_by_any_email).once.and_call_original 2.times do expect(identifier.identify_using_commit(project, '123')).to eq(user) |