Sha256: eab1f1cd0703e784eb5f16e9fa9cfc9a56ce2b76b6e6292caa3947d04874e681

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

class PhoneTest < ActiveSupport::TestCase
  context 'active model validator' do
    context 'cell phone' do
      should 'be a valid cell phone' do
        phone = Phone.new(cell_phone: '8131234567', state: 'Florida')
        assert phone.valid?, phone.errors.full_messages.inspect
      end

      should 'be an invalid cell phone' do
        phone = Phone.new(cell_phone: '123456789', state: 'Florida')
        assert phone.invalid?, phone.errors.full_messages.inspect
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
area_code_validator-0.0.4 test/dummy/test/models/phone_test.rb