2016-04-02 18:10:28 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Email, models: true do
|
|
|
|
describe 'validations' do
|
|
|
|
it_behaves_like 'an object with email-formated attributes', :email do
|
|
|
|
subject { build(:email) }
|
|
|
|
end
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
it 'normalize email value' do
|
|
|
|
expect(described_class.new(email: ' inFO@exAMPLe.com ').email)
|
|
|
|
.to eq 'info@example.com'
|
|
|
|
end
|
2016-04-02 18:10:28 +05:30
|
|
|
end
|