Sha256: 9a1ee3ad9aa6727a9d7785204a5f71c72c83a2b1e10d2558666f54364fb13c2b
Contents?: true
Size: 770 Bytes
Versions: 6
Compression:
Stored size: 770 Bytes
Contents
require 'spec_helper' describe Clearance::RackSession do it "injects a clearance session into the environment" do expected_session = "the session" expected_session.stubs(:add_cookie_to_headers) Clearance::Session.stubs(:new => expected_session) headers = { "X-Roaring-Lobster" => "Red" } app = Rack::Builder.new do use Clearance::RackSession run lambda { |env| Rack::Response.new(env[:clearance], 200, headers).finish } end env = Rack::MockRequest.env_for("/") response = Rack::MockResponse.new(*app.call(env)) Clearance::Session.should have_received(:new).with(env) response.body.should == expected_session expected_session.should have_received(:add_cookie_to_headers).with(has_entries(headers)) end end
Version data entries
6 entries across 6 versions & 1 rubygems