Hi,

I've been trying to find out how to set a client-side cookie in a request 
spec, and this is the most relevant search result that I can find, so I 
hope that you don't mind me reviving the thread....

I want to write a request spec that simulates a request where a new cookie 
value has been set by the client and then sent to a particular Rails end 
point.  As the cookie is set by the client, I can't use a previous request 
to set the client.

Is it possible to send a client-side cookie value to a request spec?

Thanks,
Neill


On Thursday, February 16, 2012 6:58:14 PM UTC+1, George Dinwiddie wrote:
>
> Meltemi,
>
> On 2/15/12 9:36 PM, Meltemi wrote:
> > I can't seem to figure out how to set a cookie for a Request spec? Tried:
> >
> > before(:each) do
> > @user = Fabricate(:user)
> > request.cookies[:id_token] = @user.id
> > end
> >
> > but that gives a NoMethodError errors: undefined method `cookies' for
> > nil:NilClass
>
> In that snippit, "request" has not been constructed and therefore is nil.
>
>   - George
>
> -- 
>   ----------------------------------------------------------------------
>    * George Dinwiddie *                      http://blog.gdinwiddie.com
>    Software Development                    http://www.idiacomputing.com
>    Consultant and Coach                    http://www.agilemaryland.org
>   ----------------------------------------------------------------------
>
> _______________________________________________
> rspec-users mailing list
> [email protected] <javascript:>
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>

-- 
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/msgid/rspec/e5b5ae8b-b83e-4687-9739-62ba5dc1c3aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to