I've got a controller that updates some attributes of a model:

def confirmation
    @cart = current_cart
    customer = Stripe::Customer.create(description: current_user.email, card: 
params[:stripeToken])
    current_user.update_attributes(stripe_customer_id: customer.id)
 end

In my spec, how can I ensure the current_user has a stripe_customer_id after 
this controller is run?

I have this:

it "should create a stripe customer and save that to the stripe_customer_id of 
the user" do
  @user.reload
  @user.stripe_customer_id.should_not be_nil
end

But it doesn't work (I tried @user.reload because the database is being updated 
by the call to current_user.update_attributes).

@user is a FactoryGirl created object further up in the test.

Thanks,
Tyler
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to