Created
April 19, 2010 22:39
-
-
Save amiel/371747 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
Transform /^\$[.\d]+$/ do |dollars| | |
dollars.to_money | |
end | |
Transform /^card "([\d\s]*)"$/ do |cc_number| | |
ActiveMerchant::Billing::CreditCard.new :number => cc_number.gsub(/\D/, '') | |
end | |
Then /^the (card "[\d\s]*") should be charged (\$[.\d]+)$/ do |credit_card, price| | |
credit_card.class # => ActiveMerchant::Billing::CreditCard | |
price.class # => Money | |
end |
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
Scenario: Register | |
... | |
Then the card "4111 1111 1111 1111" should be charged $20.00 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment