[rspec-users] Rack::Test + cookies + rspec

Ben Lovell benjamin.lovell at gmail.com
Fri Apr 16 10:59:40 EDT 2010


Try:

post 'whatever', {}, {'rack.session' => {:something=>'value'}}

To put things through the session with rack test/sinatra. 

Sent from my iPhone

On 16 Apr 2010, at 15:20, David Chelimsky <dchelimsky at gmail.com> wrote:

> On Apr 16, 2010, at 8:49 AM, Nicholas Wieland wrote:
> 
>> On Apr 16, 2010, at 3:12 PM, David Chelimsky wrote:
>> 
>>> On Apr 16, 2010, at 8:07 AM, Nicholas Wieland wrote:
>>> 
>>> What versions of rails, rspec, rspec-rails, ruby, etc?
>>> 
>>> Where does this spec live?
>> 
>> It's sinatra 1.0, not rails.
> 
> In which case this is probably not an rspec problem. Where is the set_cookie method defined in this example (from your earlier post in this thread)?
> 
>  it "should authenticate using cookies" do
>    user =Factory.create :user
>    remember_token = Charon.make_remember_token
>    set_cookie "warden=#{ remember_token }"
>    user.update :remember_token => remember_token
>    post '/authenticate'
>    last_request.env[ 'warden' ].should be_authenticated
>  end
> 
> Also, can you try the same example using test/unit? Do you get the same result?
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100416/762edbea/attachment.html>


More information about the rspec-users mailing list