Displaying 2 results from an estimated 2 matches for "finance_agr".
2007 May 01
2
Problem validating boolean
...mericality_of :term, :only_integer => true
validates_inclusion_of :linked_to_residual_value_of_asset, :in
=> [true, false]
end
and here''s the RSpec code I''m using to test it:
context "A FinanceAgreement with valid attributes" do
setup do
@finance_agreement = FinanceAgreement.new(:finance_company =>
"Jigsaw Finance", :start_date => nil,
:balance =>
5000, :term => 36, :linked_to_residual_value_of_asset => true)
end
aspect "validation" do
spec...
2007 Jul 10
2
Multiple calls to a class method
...his either once or
twice, depending on the contents of the form (one section of the form
is rendered conditionally). So I had two specs for the case where
the second form section is included:
it "..." do
Date.should_receive(:extract_from_rails_hash).
with(REQUEST_ARGS_WITH_FINANCE_AGREEMENT
[:vehicle], :registration_date).
and_return(Date.new(2006, 12, 1))
# ...
end
it "..." do
Date.should_receive(:extract_from_rails_hash).
with(REQUEST_ARGS_WITH_FINANCE_AGREEMENT
[:finance_agreement], :start_date).
and_return(Date.new(2006, 12, 4))
# ...
end...