Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 29 lines (23 sloc) 0.86 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
require 'spec_helper'

describe CreditInvoice do
  context "instance methods" do
    subject {CreditInvoice}
    let!(:cost_account) { Factory.create(:material_account) }
    let!(:credit_account) { Factory.create(:credit_account) }

    its(:direct_account) {should == Account.find_by_code('2000')}

    its(:available_debit_accounts) {should include(credit_account)}
    its(:default_debit_account) {should == Account.find_by_code('2000')}

    its(:available_credit_accounts) {should include(cost_account)}
    its(:default_credit_account) {should == Account.find_by_code('4000')}
  end

  context "when new" do
    before(:all) do
      @invoice = CreditInvoice.new
    end

    it "should return an empty string" do
      @invoice.to_s.should eq("")
      @invoice.to_s(:long).should eq("")
      @invoice.to_s(:reference).should eq("")
    end
  end
end
Something went wrong with that request. Please try again.