I have a users_controller_spec.rb with this:
describe "POST create" do
describe "with valid params" do
let(:user) { create(:user) }
it "assigns a newly created user as @user" do
post :create, user: user
assigns(:user).should be_a(User)
assigns(:user).should be_persisted
end
end
...
end
Debuggin I found that the controller receive the next params
(rdb:1) pp params{"user"=>"1", "controller"=>"users", "action"=>"create"}
Why "user" => "1" ?, why is not passing the user object properly ?
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/rspec/-/JiqgAausR3UJ.
For more options, visit https://groups.google.com/groups/opt_out.