On Wed, Feb 15, 2012 at 8:36 PM, Meltemi <mdemetr...@gmail.com> 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
>
> How does one run request specs when cookies need to be simulated?
> Using Capybara if that matters

Request specs wrap Rails' integration tests, which simulate browser
interaction, but that's all. The idea is to not stub, simulate, etc,
anything internal at all. It's OK to create the `@user`, but cookies
should get set by making other requests that do so. Make sense?
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to