Created
January 17, 2012 09:16
-
-
Save rounders/1625808 to your computer and use it in GitHub Desktop.
problem with build_source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context "#build_source" do | |
let(:payment_method) { Factory(:bogus_payment_method) } | |
it "should build the payment's source" do | |
params = { :amount => 100, :payment_method_id => payment_method.id, | |
:source_attributes => {:year=>"2012", :month =>"1", :number => '1234567890123',:verification_value => '123'}} | |
payment = Spree::Payment.new(params) | |
payment.should be_valid | |
payment.source.should_not be_nil | |
end | |
context "with the params hash ordered differently" do | |
it "should build the payment's source" do | |
params = { | |
:source_attributes => {:year=>"2012", :month =>"1", :number => '1234567890123',:verification_value => '123'}, | |
:amount => 100, :payment_method_id => payment_method.id | |
} | |
payment = Spree::Payment.new(params) | |
payment.should be_valid | |
payment.source.should_not be_nil | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruby 1.8.7p352 - both tests pass
ree - sometimes fails, sometimes passes
ruby 1.8.7p357 - sometimes fails, sometimes passes
ruby 1.9.2p290 - 1st test passes, 2nd test fails
ruby 1.9.3p0 - 1st test passes, 2nd test fails