Sha256: 12edf16da25c830eeb15657a4574da2eb20f003aa352b1cd2cb7bfcf14c63236

Contents?: true

Size: 685 Bytes

Versions: 22

Compression:

Stored size: 685 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__)))

describe "cookies plugin" do 
  it "should set cookies on response" do
    app(:cookies) do |r|
      response.set_cookie("foo", "bar")
      response.set_cookie("bar", "baz")
      "Hello"
    end

    header('Set-Cookie').must_equal "foo=bar\nbar=baz"
    body.must_equal 'Hello'
  end

  it "should delete cookies on response" do
    app(:cookies) do |r|
      response.set_cookie("foo", "bar")
      response.delete_cookie("foo")
      "Hello"
    end

    header('Set-Cookie').must_match(/foo=; (max-age=0; )?expires=Thu, 01[ -]Jan[ -]1970 00:00:00 (-0000|GMT)/)
    body.must_equal 'Hello'
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
roda-2.23.0 spec/plugin/cookies_spec.rb
roda-2.22.0 spec/plugin/cookies_spec.rb
roda-2.21.0 spec/plugin/cookies_spec.rb
roda-2.20.0 spec/plugin/cookies_spec.rb
roda-2.19.0 spec/plugin/cookies_spec.rb
roda-2.18.0 spec/plugin/cookies_spec.rb
roda-2.17.0 spec/plugin/cookies_spec.rb
roda-2.16.0 spec/plugin/cookies_spec.rb
roda-2.15.0 spec/plugin/cookies_spec.rb
roda-2.14.0 spec/plugin/cookies_spec.rb
roda-2.13.0 spec/plugin/cookies_spec.rb
roda-2.12.0 spec/plugin/cookies_spec.rb
roda-2.11.0 spec/plugin/cookies_spec.rb
roda-2.10.0 spec/plugin/cookies_spec.rb
roda-2.9.0 spec/plugin/cookies_spec.rb
roda-2.8.0 spec/plugin/cookies_spec.rb
roda-2.7.0 spec/plugin/cookies_spec.rb
roda-2.6.0 spec/plugin/cookies_spec.rb
roda-2.5.1 spec/plugin/cookies_spec.rb
roda-2.5.0 spec/plugin/cookies_spec.rb