Sha256: 9e47a2a76bf62d7077396c03474c942ea222d842192caf441c3d1a8c3dd5740f

Contents?: true

Size: 998 Bytes

Versions: 53

Compression:

Stored size: 998 Bytes

Contents

require 'spec_helper'
require 'rack'

describe Dragonfly::CookieMonster do

  def app(extra_env={})
    Rack::Builder.new do
      use Dragonfly::CookieMonster
      run proc{|env| env.merge!(extra_env); [200, {"Set-Cookie" => "blah", "Something" => "else"}, ["body here"]] }
    end
  end

  it "should not delete the set-cookie header from the response if the response doesn't come from dragonfly" do
    response = Rack::MockRequest.new(app).get('')
    response.status.should == 200
    response.body.should == "body here"
    response.headers["Set-Cookie"].should == "blah"
    response.headers["Something"].should == "else"
  end

  it "should delete the set-cookie header from the response if the response comes from dragonfly" do
    response = Rack::MockRequest.new(app('dragonfly.job' => mock)).get('')
    response.status.should == 200
    response.body.should == "body here"
    response.headers["Set-Cookie"].should be_nil
    response.headers["Something"].should == "else"
  end

end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.7.4 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.7.3 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.7.2 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.7.1 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.7.0 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
dragonfly-0.9.15 spec/dragonfly/cookie_monster_spec.rb
dragonfly-0.9.14 spec/dragonfly/cookie_monster_spec.rb
dragonfly-0.9.13 spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.9 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.8 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.7 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.6 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.5 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.4 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.3 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.2 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.1 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.6.0 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb
classiccms-0.5.17 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/cookie_monster_spec.rb