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.
The line
@user.save
in Listing 6.5 gives the following error:The actual line should be:
@user = FactoryGirl.create :user
which agrees with the previous contexts as well. The tests succeed at this point.