spec/rack/test/cookie_spec.rb in rack-test-0.4.1 vs spec/rack/test/cookie_spec.rb in rack-test-0.4.2
- old
+ new
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + "/../../spec_helper"
+require "spec_helper"
describe Rack::Test::Session do
def have_body(string)
simple_matcher "have body #{string.inspect}" do |response|
response.body.should == string
@@ -140,9 +140,15 @@
it "allows an array of cookies to be set" do
set_cookie ["value=10", "foo=bar"]
get "/cookies/show"
last_request.cookies.should == { "value" => "10", "foo" => "bar" }
+ end
+
+ it "parses multiple cookies properly" do
+ get "/cookies/set-multiple"
+ get "/cookies/show"
+ last_request.cookies.should == { "key1" => "value1", "key2" => "value2" }
end
it "supports multiple sessions" do
with_session(:first) do
get "/cookies/set", "value" => "1"