Created
September 7, 2011 17:07
-
-
Save knewter/1201122 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
Given /^user "([^"]*)" has selected "([^"]*)" as his receive funds method$/ do |user, receive_funds_method| | |
u = model("user \"#{user}\"") | |
$ai = u.account_information | |
$ai.stubs(:receive_funds_method_raw).returns(receive_funds_method) | |
# Oh gods of ruby, do not be angry with me, for I could find no other way -ja | |
eval <<-EOF | |
class User < ActiveRecord::Base | |
alias_method :original_account_information, :account_information | |
def account_information | |
if id == #{u.id} | |
$ai | |
else | |
original_account_information | |
end | |
end | |
end | |
EOF | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment