Sha256: a034e5b5e48743ab636834154f39ccae02dcff5508ace029c1a8acfea5d534d0

Contents?: true

Size: 414 Bytes

Versions: 41

Compression:

Stored size: 414 Bytes

Contents

require 'spec_helper'

describe EmailValidator do
  before(:each) do
    class User < ActiveRecord::Base
      validates :email, :email => true
    end
  end

  it 'should allow valid emails' do
    Fabricate(:user) do
      email "good@email.com"
    end.should be_valid
  end

  it 'should not allow invalid emails' do
    Fabricate.build(:user) do
      email "notanemail"
    end.should_not be_valid
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.23 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.22 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.21 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.20 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.19 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.18 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.17 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.16 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.14 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.13 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.12 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.11 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.10 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.9 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.7 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.5 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.4 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.3 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.2 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.1 spec/validators/email_validator_spec.rb