On Wednesday, November 21, 2012 2:28:08 PM UTC-6, Javix wrote:
>
> I was aware that I should pass client_id needed in the before_filter call
> (correct me if I'm wrong), that's why I put it in the post title. More of
> that, find_client method should get it as follows:
>
> def find_client
> @client = Client.find(params[:account][:client_id])
> end
>
> and I can't figure out hot to pass it in the spec, I believed that
> building an account the way I did would solve it, but was wrong.
> So really, I can't see how.
>
This line in the spec is not doing what you think it's doing:
post :create, account: attributes_for(:account, client: client)
What you want there is something like:
post :create, account: {client_id: client.id}
HTH,
David
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/rspec/-/dtx3COMShfoJ.
For more options, visit https://groups.google.com/groups/opt_out.