class CookiesTest::TestController

Public Instance Methods

access_frozen_cookies() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 115
def access_frozen_cookies
  cookies["will"] = "work"
  head :ok
end
authenticate() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 89
def authenticate
  cookies["user_name"] = "david"
  head :ok
end
authenticate_for_fourteen_days() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 99
def authenticate_for_fourteen_days
  cookies["user_name"] = { "value" => "david", "expires" => Time.utc(2005, 10, 10, 5) }
  head :ok
end
authenticate_for_fourteen_days_with_symbols() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 104
def authenticate_for_fourteen_days_with_symbols
  cookies[:user_name] = { value: "david", expires: Time.utc(2005, 10, 10, 5) }
  head :ok
end
authenticate_with_http_only() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 132
def authenticate_with_http_only
  cookies["user_name"] = { value: "david", httponly: true }
  head :ok
end
authenticate_with_secure() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 137
def authenticate_with_secure
  cookies["user_name"] = { value: "david", secure: true }
  head :ok
end
logout() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 120
def logout
  cookies.delete("user_name")
  head :ok
end
Also aliased as: delete_cookie
noop() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 274
def noop
  head :ok
end
raise_data_overflow() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 192
def raise_data_overflow
  cookies.signed[:foo] = "bye!" * 1024
  head :ok
end
set_multiple_cookies() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 109
def set_multiple_cookies
  cookies["user_name"] = { "value" => "david", "expires" => Time.utc(2005, 10, 10, 5) }
  cookies["login"]     = "XJ-122"
  head :ok
end
set_with_with_escapable_characters() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 94
def set_with_with_escapable_characters
  cookies["that & guy"] = "foo & bar => baz"
  head :ok
end
string_key() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 259
def string_key
  cookies["user_name"] = "dhh"
  head :ok
end
string_key_mock() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 269
def string_key_mock
  cookies["user_name"] = "david" if cookies["user_name"] == "andrew"
  head :ok
end
symbol_key() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 254
def symbol_key
  cookies[:user_name] = "david"
  head :ok
end
symbol_key_mock() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 264
def symbol_key_mock
  cookies[:user_name] = "david" if cookies[:user_name] == "andrew"
  head :ok
end
tampered_cookies() click to toggle source
# File actionpack/test/dispatch/cookies_test.rb, line 197
def tampered_cookies
  cookies[:tampered] = "BAh7BjoIZm9vIghiYXI%3D--123456780"
  cookies.signed[:tampered]
  head :ok
end