Re: [rspec-users] Cookies...

2009-08-14 Thread Stephen Eley
On Fri, Aug 14, 2009 at 10:35 AM, Denis Haskin wrote: > > (in application_helper_spec.rb) >     it "should return false and set the cookie to true if it is not set" do >   cookies[:fp_skip_hp_video].should == nil >   skip_hp_video.should == false >   cookies[:fp_skip_hp_video].should in

[rspec-users] Cookies...

2009-08-14 Thread Denis Haskin
Cookies continue to bedevil me in rspec. The doc seems to imply they're supported now (http://rspec.info/rails/changes-rspec-rails.html: "* Added proxy to cookies so you can set them in examples the same way you set them in controllers"). Maybe because it's because I'm trying to use them in

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread David Chelimsky
On Jul 2, 2008, at 1:44 PM, Craig Demyanovich wrote: I'm thinking of replacing the existing cookies() method (in the example) with one that returns a CookieJarProxy that will allow you to do any of the following: cookies['cookie_key'] = 'cookie value' cookies[:cookie_key] = 'cookie value'

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread Craig Demyanovich
> I'm thinking of replacing the existing cookies() method (in the example) > with one that returns a CookieJarProxy that will allow you to do any of the > following: > > cookies['cookie_key'] = 'cookie value' > cookies[:cookie_key] = 'cookie value' > > cookies['cookie_key'].should == 'cookie value'

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread David Chelimsky
On Jul 2, 2008, at 1:21 PM, Christopher Bailey wrote: On Wed, Jul 2, 2008 at 10:52 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: On Jul 2, 2008, at 12:42 PM, Christopher Bailey wrote: First, nevermind! Oy! I finally figured it out. The reason it wasn't working in my controller code was

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread David Chelimsky
On Jul 2, 2008, at 1:21 PM, Christopher Bailey wrote: On Wed, Jul 2, 2008 at 10:52 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: On Jul 2, 2008, at 12:42 PM, Christopher Bailey wrote: First, nevermind! Oy! I finally figured it out. The reason it wasn't working in my controller code was

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread Christopher Bailey
On Wed, Jul 2, 2008 at 10:52 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jul 2, 2008, at 12:42 PM, Christopher Bailey wrote: > >> First, nevermind! Oy! I finally figured it out. The reason it >> wasn't working in my controller code was that I was checking for >> "cookies[:cookie_key]", n

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread David Chelimsky
On Jul 2, 2008, at 12:42 PM, Christopher Bailey wrote: First, nevermind! Oy! I finally figured it out. The reason it wasn't working in my controller code was that I was checking for "cookies[:cookie_key]", not "request.cookies[:cookie_key]"! It's a bit strange how that manifested, given the

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread Christopher Bailey
First, nevermind! Oy! I finally figured it out. The reason it wasn't working in my controller code was that I was checking for "cookies[:cookie_key]", not "request.cookies[:cookie_key]"! It's a bit strange how that manifested, given the fact that referencing just "cookies" was a hash with value

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread Craig Demyanovich
My pair and I struggled with this a little bit last week. We decided to just use a hash to represent cookies in specs, since that's how we're interacting with it. You can see the specs that we wrote here: http://pastie.org/226443 . Regards, Craig ___ rsp

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread Christopher Bailey
On Wed, Jul 2, 2008 at 9:41 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jul 2, 2008, at 11:15 AM, Christopher Bailey wrote: > >> On Wed, Jul 2, 2008 at 4:06 AM, David Chelimsky <[EMAIL PROTECTED]> >> wrote: >> >>> >>> This is just one of those goofy things in Rails testing. I'm not sure >>

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread David Chelimsky
On Jul 2, 2008, at 11:15 AM, Christopher Bailey wrote: On Wed, Jul 2, 2008 at 4:06 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: This is just one of those goofy things in Rails testing. I'm not sure the best way to make it easier in rspec without breaking existing examples in the process.

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread Christopher Bailey
On Wed, Jul 2, 2008 at 4:06 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > > This is just one of those goofy things in Rails testing. I'm not sure > the best way to make it easier in rspec without breaking existing > examples in the process. Regardless, here's how you interact with > cookies fro

Re: [rspec-users] Cookies - how to set in controller specs?

2008-07-02 Thread David Chelimsky
On Tue, Jul 1, 2008 at 6:37 PM, Christopher Bailey <[EMAIL PROTECTED]> wrote: > I've been searching Google, the mailing list, etc, etc. and can't for > the life of me get a cookie to be set in a controller spec. From > everything I've read on the web, it appears all I need to do is the > typical:

[rspec-users] Cookies - how to set in controller specs?

2008-07-01 Thread Christopher Bailey
I've been searching Google, the mailing list, etc, etc. and can't for the life of me get a cookie to be set in a controller spec. From everything I've read on the web, it appears all I need to do is the typical: cookies[:name] = value or cookies[:name] = { :value => something, :expires => 1

Re: [rspec-users] Cookies in RSpec

2007-10-05 Thread Priit Tamboom
On 10/4/07, Nathan Sutton <[EMAIL PROTECTED]> wrote: > So how do you work with cookies properly in rspec now? I noticed in > the docs that it mentions session, assigns, and flash, but nothing of > cookie. I'm using edge rails so I'm concerned about changes to the > cookie mechanisms. I need to a

[rspec-users] Cookies in RSpec

2007-10-04 Thread Nathan Sutton
So how do you work with cookies properly in rspec now? I noticed in the docs that it mentions session, assigns, and flash, but nothing of cookie. I'm using edge rails so I'm concerned about changes to the cookie mechanisms. I need to assign values into the cookie (a remember token for re