Sha256: 17940220375255215542f7aa588ee7ce8dfce9b7b4dc87699c6c11ec4a861e76
Contents?: true
Size: 824 Bytes
Versions: 2
Compression:
Stored size: 824 Bytes
Contents
require 'unit_test_helper' class PhoneTest < Test::Unit::TestCase include TestHelper def setup @client = Xeroizer::OAuth2Application.new(CLIENT_ID, CLIENT_SECRET) @contact = @client.Contact.build end context "validators" do should "not allow long phone numbers" do @phone = @contact.add_phone(phone_number: "1234567890123456789012345678901234567890123456789012345678901234567890") assert_equal(false, @phone.valid?) blank_error = @phone.errors_for(:phone_number).first assert_not_nil(blank_error) assert_equal("must be shorter than 50 characters", blank_error) end should "allow phone numbers" do @phone = @contact.add_phone(phone_number: "12345690") assert_equal(true, @phone.valid?) assert_equal(0, @phone.errors.size) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
xeroizer-3.0.1 | test/unit/models/phone_test.rb |
xeroizer-3.0.0 | test/unit/models/phone_test.rb |