Sha256: 7f75fa7c6d5d88b211448dff238ac24634c96389394f0b347904580fd4f78e8a

Contents?: true

Size: 667 Bytes

Versions: 1

Compression:

Stored size: 667 Bytes

Contents

require 'spec_helper'

describe EmailFormatValidator do

  let(:fake_model) { FakeModel.new }

  context "with valid emails" do

    let(:valid_emails) { %w(valid@email.com another.valid@email.email.net) }

    it "should be happy" do
      valid_emails.each do |email|
        fake_model.email = email
        expect(fake_model.valid?).to be_true
      end
    end
  end

  context "with invalid emails" do

    let(:invalid_emails) { %w(invalid_email@ another_invalid_email@@email.email) }

    it "shouldn't be happy" do
      invalid_emails.each do |email|
        fake_model.email = email
        expect(fake_model.valid?).to be_false
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
email_format-0.0.1 spec/email_format_validator_spec.rb