diff options
author | Brett Walker <bwalker@gitlab.com> | 2017-10-27 16:32:48 +0200 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2017-10-27 16:32:48 +0200 |
commit | a2894b7ad2b26ff65d36b9c87b79c60ff4ddda59 (patch) | |
tree | 4565a0500c7316a826dc799cac5c7b65dabfc572 /spec/models | |
parent | 48851ff308032105234b781c61bfae8f312aced7 (diff) | |
download | gitlab-ce-a2894b7ad2b26ff65d36b9c87b79c60ff4ddda59.tar.gz |
use a delegate for `username` to be more future friendly
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/email_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/email_spec.rb b/spec/models/email_spec.rb index b32dd31ae6d..4676612ad52 100644 --- a/spec/models/email_spec.rb +++ b/spec/models/email_spec.rb @@ -40,4 +40,12 @@ describe Email do expect(user.emails.confirmed.count).to eq 1 end end + + describe 'delegation' do + let(:user) { create(:user) } + + it 'delegates to :user' do + expect(build(:email, user: user).username).to eq user.username + end + end end |