Skip to content

Commit

Permalink
Invoices helper spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanbibat committed Jun 2, 2014
1 parent 8b8da25 commit da5dbca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/helpers/invoices_helper_spec.rb
@@ -0,0 +1,16 @@
require 'spec_helper'

describe InvoicesHelper do
describe "display_purchase" do
it "should display description of the purchase of the invoice" do
mock_purchase = stub_model(Purchase, :description => "a description")
mock_invoice = stub_model(Invoice, :purchase => mock_purchase)
helper.display_purchase(mock_invoice).should include "a description"
end

it "should display a default message if there is no purchase" do
mock_invoice = stub_model(Invoice, :purchase => nil)
helper.display_purchase(mock_invoice).should == "(no Purchase set)"
end
end
end

0 comments on commit da5dbca

Please sign in to comment.