summaryrefslogtreecommitdiff
path: root/spec/models/email_spec.rb
blob: fe4de1b2afb162b8e655f0b2e0fb59d558447ba4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

  it 'normalize email value' do
    expect(described_class.new(email: ' inFO@exAMPLe.com ').email)
      .to eq 'info@example.com'
  end
end