Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@user.save in Listing 6.5 gives an error. Fixed. #58

Open
SpacyRicochet opened this issue Jan 11, 2016 · 0 comments
Open

@user.save in Listing 6.5 gives an error. Fixed. #58

SpacyRicochet opened this issue Jan 11, 2016 · 0 comments

Comments

@SpacyRicochet
Copy link

The line @user.save in Listing 6.5 gives the following error:

Failures:

  1) Api::V1::UsersController#products association do destroys the associated products on self destruct
     Failure/Error: @user.save
     NoMethodError:
       undefined method `save' for nil:NilClass
     # ./spec/controllers/api/v1/users_controller_spec.rb:103:in `block (3 levels) in <top (required)>'

The actual line should be:

@user = FactoryGirl.create :user

which agrees with the previous contexts as well. The tests succeed at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant