Methods
S
T
Attributes
[R] request
Instance Public methods
setup()
# File actionpack/test/dispatch/cookies_test.rb, line 9
def setup
  @request = ActionDispatch::Request.empty
end
test_each()
# File actionpack/test/dispatch/cookies_test.rb, line 43
def test_each
  request.cookie_jar['foo'] = :bar
  list = []
  request.cookie_jar.each do |k,v|
    list << [k, v]
  end

  assert_equal [['foo', :bar]], list
end
test_enumerable()
# File actionpack/test/dispatch/cookies_test.rb, line 53
def test_enumerable
  request.cookie_jar['foo'] = :bar
  actual = request.cookie_jar.map { |k,v| [k.to_s, v.to_s] }
  assert_equal [['foo', 'bar']], actual
end
test_fetch()
# File actionpack/test/dispatch/cookies_test.rb, line 13
def test_fetch
  x = Object.new
  assert_not request.cookie_jar.key?('zzzzzz')
  assert_equal x, request.cookie_jar.fetch('zzzzzz', x)
  assert_not request.cookie_jar.key?('zzzzzz')
end
test_fetch_block()
# File actionpack/test/dispatch/cookies_test.rb, line 26
def test_fetch_block
  x = Object.new
  assert_not request.cookie_jar.key?('zzzzzz')
  assert_equal x, request.cookie_jar.fetch('zzzzzz') { x }
end
test_fetch_exists()
# File actionpack/test/dispatch/cookies_test.rb, line 20
def test_fetch_exists
  x = Object.new
  request.cookie_jar['foo'] = 'bar'
  assert_equal 'bar', request.cookie_jar.fetch('foo', x)
end
test_fetch_type_error()
# File actionpack/test/dispatch/cookies_test.rb, line 37
def test_fetch_type_error
  assert_raises(KeyError) do
    request.cookie_jar.fetch(:omglolwut)
  end
end
test_key_is_to_s()
# File actionpack/test/dispatch/cookies_test.rb, line 32
def test_key_is_to_s
  request.cookie_jar['foo'] = 'bar'
  assert_equal 'bar', request.cookie_jar.fetch(:foo)
end
test_key_methods()
# File actionpack/test/dispatch/cookies_test.rb, line 59
def test_key_methods
  assert !request.cookie_jar.key?(:foo)
  assert !request.cookie_jar.has_key?("foo")

  request.cookie_jar[:foo] = :bar
  assert request.cookie_jar.key?(:foo)
  assert request.cookie_jar.has_key?("foo")
end
test_write_doesnt_set_a_nil_header()
# File actionpack/test/dispatch/cookies_test.rb, line 68
def test_write_doesnt_set_a_nil_header
  headers = {}
  request.cookie_jar.write(headers)
  assert !headers.include?('Set-Cookie')
end