-
-
Save tomkersten/57599 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
def new | |
#send .nil? then you can stub that on @billing_information | |
if !user.billing_information.nil? | |
user.build_billing_information | |
user.billing_information.first_name = user.first_name | |
user.billing_information.last_name = user.last_name | |
user.billing_information.postal_code = user.profile.postal_code | |
end | |
define_subscription_details | |
end | |
describe "a GET to new without a subscription and without billing information" do | |
before do | |
#as_null_object will catch #first_name=, etc so you don't have to stub them all | |
@billing_information = mock(BillingInformation, :nil? => true).as_null_object | |
@user.stub!(:subscription).and_return(nil) | |
# like this | |
@user.stub!(:billing_information).and_return(@billing_information) | |
end | |
it "should get the new subscription page" do | |
get :new | |
response.should be_success | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment