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.11 spec/validators/email_validator_spec.rb
iugusdk-1.0.10 spec/validators/email_validator_spec.rb
iugusdk-1.0.9 spec/validators/email_validator_spec.rb
iugusdk-1.0.8 spec/validators/email_validator_spec.rb
iugusdk-1.0.7 spec/validators/email_validator_spec.rb
iugusdk-1.0.6 spec/validators/email_validator_spec.rb
iugusdk-1.0.5 spec/validators/email_validator_spec.rb
iugusdk-1.0.4 spec/validators/email_validator_spec.rb
iugusdk-1.0.3 spec/validators/email_validator_spec.rb
iugusdk-1.0.2 spec/validators/email_validator_spec.rb
iugusdk-1.0.1 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.32 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.31 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.30 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.29 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.28 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.27 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.26 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.25 spec/validators/email_validator_spec.rb
iugusdk-1.0.0.alpha.24 spec/validators/email_validator_spec.rb