Sha256: f29b769f9a9590ad133dd5dd5526f55234855a1f2874478249838ebaa89a7ee4

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe CustomerFinancial do
  
  let (:customer) { Factory(:customer_pj).customer }
  
  before do
    @financial_data = CustomerFinancial.new(
                        :customer => customer,
                        :contact_leader_id => Factory(:contact, :customer => customer),
                        :notes => Faker::Lorem.sentence(100)[1..1000]       
                      )
    
  end
  
  subject { @financial_data }


  it { should respond_to(:customer) }
  it { should respond_to(:leader) }
  it { should respond_to(:billing_address_different) }  
  it { should respond_to(:billing_addresses) }
  it { should respond_to(:payment_pending) }
  it { should respond_to(:payment_pending_message) }
  it { should respond_to(:notes) }
  
  describe "Billing Address Different" do
    let!(:address) do
      Factory(:address,
        :state_id => State.first,
        :city_id => City.first,
        :district_id => Factory(:district),
        :address => Faker::Lorem.sentence(2)[1..120],
        :postal_code => "60000100",
        :addressable => @financial_data
      )
    end
    
    before do
      @financial_data.billing_address_different = true
      @financial_data.billing_addresses << address
    end
    
    its(:billing_addresses) { should include(address) }
  
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
guara-0.0.3 spec/models/customer_financial_spec.rb
guara-0.0.1.rc spec/models/customer_financial_spec.rb