diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-24 01:04:21 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-24 01:07:15 +0300 |
commit | e9b65a3e05ca3bf4ea42f547f42a133802037b7e (patch) | |
tree | eefde4c68650f1d1b9eae5201fb2a885c04026ff /spec | |
parent | 764b5913c8f960d09d4777e3233662f507b0ec13 (diff) |
Only look up Commit authors/committers by email
- Removes looking up authors/committers by name
- Renames `User.find_for_commit` to `User.find_by_any_email`
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_spec.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b80273c053d..6d2423ae27a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -366,28 +366,22 @@ describe User do end end - describe '.find_for_commit' do + describe '.find_by_any_email' do it 'finds by primary email' do user = create(:user, email: 'foo@example.com') - expect(User.find_for_commit(user.email, '')).to eq user + expect(User.find_by_any_email(user.email)).to eq user end it 'finds by secondary email' do email = create(:email, email: 'foo@example.com') user = email.user - expect(User.find_for_commit(email.email, '')).to eq user - end - - it 'finds by name' do - user = create(:user, name: 'Joey JoJo') - - expect(User.find_for_commit('', 'Joey JoJo')).to eq user + expect(User.find_by_any_email(email.email)).to eq user end it 'returns nil when nothing found' do - expect(User.find_for_commit('', '')).to be_nil + expect(User.find_by_any_email('')).to be_nil end end |