Sha256: 72633c162c307d9e0ce1f5a8a8be718f6cc0ac7e0f73bd68baf45b00b3efb9f6

Contents?: true

Size: 815 Bytes

Versions: 5

Compression:

Stored size: 815 Bytes

Contents

require 'spec_helper'
describe Payment do
  before(:each) do
    @plan = Factory.build(:plan, :name => "Gold", :price => 20)
    @contact_info = Factory.build(:contact_info)

    @credit_card = Factory.build(:credit_card)
    
    @subscription = Factory(:subscription, :contact_info => @contact_info, :plan => @plan, :credit_card => @credit_card)
    
    @subscription.update_attributes(:balance => 15)
    @payment = Factory(:payment, :amount => 12, :subscription => @subscription)
    @user = Factory(:user, :subscription => @subscription)
    
  end
  
  
  it 'should create a successful transaction on update' do
    @payment.should_receive(:charge_subscription)
    @payment.save
  end
  
  it 'should set status to paid after bill!' do
    @payment.save
    @payment.status.should == 'paid'
  end
  
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

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