Sha256: f611c8ba1e82ac78e028ebf1458bcf33c2abfdba6637a144581a6f1d1d2b5086
Contents?: true
Size: 840 Bytes
Versions: 20
Compression:
Stored size: 840 Bytes
Contents
require File.expand_path("spec_helper", File.dirname(__FILE__)) describe "session handling" do it "should give a warning if session variable is not available" do app do |r| begin session rescue Exception => e e.message end end body.must_match(/use Rack::Session::Cookie/) end it "should return session if available" do app(:bare) do use Rack::Session::Cookie, :secret=>'1' route do |r| r.on do (session[1] ||= 'a'.dup) << 'b' session[1] end end end _, h, b = req b.join.must_equal 'ab' _, h, b = req('HTTP_COOKIE'=>h['Set-Cookie'].sub("; path=/; HttpOnly", '')) b.join.must_equal 'abb' _, h, b = req('HTTP_COOKIE'=>h['Set-Cookie'].sub("; path=/; HttpOnly", '')) b.join.must_equal 'abbb' end end
Version data entries
20 entries across 20 versions & 1 rubygems