diff options
author | Semyon Pupkov <semen.pupkov@gmail.com> | 2016-05-23 12:19:27 +0300 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2016-10-23 15:30:07 +0300 |
commit | b1ce2eb1e5f6a4a5b413381489fbb7e63ff3e1e5 (patch) | |
tree | e534764412d32517b1e7e06e86b0516025472311 /spec/models | |
parent | a98ad03ba18da0b1534f36dafafa9a1c644d0bf1 (diff) |
refactor(email): use setter method instead AR callbacks
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/email_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/email_spec.rb b/spec/models/email_spec.rb index d9df9e0f907..fe4de1b2afb 100644 --- a/spec/models/email_spec.rb +++ b/spec/models/email_spec.rb @@ -6,4 +6,9 @@ describe Email, models: true do subject { build(:email) } end end + + it 'normalize email value' do + expect(described_class.new(email: ' inFO@exAMPLe.com ').email) + .to eq 'info@example.com' + end end |