Sha256: bb4da588a617e06c387e0037ae889a75ff8313b71bb978f5ae33f749d9cd8f8b

Contents?: true

Size: 764 Bytes

Versions: 2

Compression:

Stored size: 764 Bytes

Contents

require 'spec_helper'

describe SimpleShipping::Contact do
  it { should be_kind_of SimpleShipping::Abstract::Model }

  describe 'attributes' do
    it { should have_attribute :person_name }
    it { should have_attribute :company_name }
    it { should have_attribute :phone_number }
    it { should have_attribute :email }
  end

  describe 'validations' do
    it {should validate_presence_of :phone_number }

    it 'person_name or company_name should be present' do
      contact = SimpleShipping::Contact.new(:phone_number => '123')
      contact.should_not be_valid

      contact.person_name = "John"
      contact.should be_valid

      contact.person_name  = nil
      contact.company_name = "Osborn Inc"
      contact.should be_valid
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_shipping-0.4.7 spec/lib/simple_shipping/contact_spec.rb
simple_shipping-0.4.6 spec/lib/simple_shipping/contact_spec.rb