Sha256: 6515ba09d602bc20e8639ac01d5b12d38bf74607905865a4aaec1f978de15fb7

Contents?: true

Size: 728 Bytes

Versions: 5

Compression:

Stored size: 728 Bytes

Contents

require 'spec_helper'

describe Invoice do
  it { should belong_to :billing_activity }
  it { should have_many :invoice_line_items }

  describe 'on create' do

    before(:all) do
      plan = Factory.build(:plan, :name => "Gold", :price => 20.0)
      contact_info = Factory.build(:contact_info)
      credit_card = Factory.build(:credit_card)
      @subscription = Factory.build(:subscription, :contact_info => contact_info, :plan => plan, :credit_card => credit_card)
      @subscription.save
    end
  
    it 'should send invoice_created email' do
      ActionMailer::Base.deliveries = [];
      @subscription.invoice!
      ActionMailer::Base.deliveries.first.subject.should =~ /Invoice Created/      
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saasaparilla-0.2.2 spec/models/invoice_spec.rb
saasaparilla-0.2.1 spec/models/invoice_spec.rb
saasaparilla-0.1.8 spec/models/invoice_spec.rb
saasaparilla-0.1.7 spec/models/invoice_spec.rb
saasaparilla-0.1.6 spec/models/invoice_spec.rb