Created
July 29, 2009 19:56
-
-
Save supriya/158361 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
return result.fail_with("The card doesn't have any available credit.") unless @card.credit_account && @card.credit_account.has_credit? | |
return result.fail_with('Credit Account is frozen.') if @card.credit_account.frozen_credit? | |
tests | |
context "with frozen credit" do | |
setup do | |
@card.credit_account.freeze_credit! | |
@result = CallHandler.top_up_card(:version => :v1, :account_number => @card_with_topup.pan, :transaction_amount => @transaction_amount, :available_balance => 488.00, :ip_address => "127.0.0.01") | |
end | |
# | |
should "fail" do | |
assert_equal false, @result.success? | |
end | |
# | |
should_change "CallHandlerLogEntry.unsuccessful.for_method('top_up_card').count", :by =>1 | |
should_not_change "CardTopUpTransaction.count" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment