You need to start a memcached server inorder to run these tests

Namespace
Methods
S
T
Included Modules
Instance Public methods
setup()
# File activesupport/test/caching_test.rb, line 699
def setup
  @cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :expires_in => 60)
  @peek = ActiveSupport::Cache.lookup_store(:mem_cache_store)
  @data = @cache.instance_variable_get(:@data)
  @cache.clear
  @cache.silence!
end
test_deserializes_unloaded_class()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 125
def test_deserializes_unloaded_class
  with_test_route_set do
    with_autoload_path "session_autoload_test" do
      get '/set_serialized_session_value'
      assert_response :success
      assert cookies['_session_id']
    end
    with_autoload_path "session_autoload_test" do
      get '/get_session_id'
      assert_response :success
    end
    with_autoload_path "session_autoload_test" do
      get '/get_session_value'
      assert_response :success
      assert_equal 'foo: #<SessionAutoloadTest::Foo bar:"baz">', response.body, "should auto-load unloaded class"
    end
  end
end
test_getting_from_nonexistent_session()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 82
def test_getting_from_nonexistent_session
  with_test_route_set do
    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body
    assert_nil cookies['_session_id'], "should only create session on write, not read"
  end
end
test_getting_nil_session_value()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 55
def test_getting_nil_session_value
  with_test_route_set do
    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body
  end
end
test_getting_session_id()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 112
def test_getting_session_id
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']
    session_id = cookies['_session_id']

    get '/get_session_id'
    assert_response :success
    assert_equal session_id, response.body, "should be able to read session id without accessing the session hash"
  end
end
test_getting_session_value_after_session_reset()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 63
def test_getting_session_value_after_session_reset
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']
    session_cookie = cookies.send(:hash_for)['_session_id']

    get '/call_reset_session'
    assert_response :success
    assert_not_equal [], headers['Set-Cookie']

    cookies << session_cookie # replace our new session_id with our old, pre-reset session_id

    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body, "data for this session should have been obliterated from memcached"
  end
end
test_local_cache_raw_values()
# File activesupport/test/caching_test.rb, line 726
def test_local_cache_raw_values
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.with_local_cache do
    cache.write("foo", 2)
    assert_equal "2", cache.read("foo")
  end
end
test_local_cache_raw_values_with_marshal()
# File activesupport/test/caching_test.rb, line 735
def test_local_cache_raw_values_with_marshal
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.with_local_cache do
    cache.write("foo", Marshal.dump([]))
    assert_equal [], cache.read("foo")
  end
end
test_prevents_session_fixation()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 156
def test_prevents_session_fixation
  with_test_route_set do
    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body
    session_id = cookies['_session_id']

    reset!

    get '/set_session_value', :_session_id => session_id
    assert_response :success
    assert_not_equal session_id, cookies['_session_id']
  end
end
test_raw_values()
# File activesupport/test/caching_test.rb, line 712
def test_raw_values
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.write("foo", 2)
  assert_equal "2", cache.read("foo")
end
test_raw_values_with_marshal()
# File activesupport/test/caching_test.rb, line 719
def test_raw_values_with_marshal
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.write("foo", Marshal.dump([]))
  assert_equal [], cache.read("foo")
end
test_setting_and_getting_session_value()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 43
def test_setting_and_getting_session_value
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']

    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: "bar"', response.body
  end
end
test_setting_session_value_after_session_reset()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 91
def test_setting_session_value_after_session_reset
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']
    session_id = cookies['_session_id']

    get '/call_reset_session'
    assert_response :success
    assert_not_equal [], headers['Set-Cookie']

    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body

    get '/get_session_id'
    assert_response :success
    assert_not_equal session_id, response.body
  end
end