Sha256: 155c3df4de225ff0e651e973aa70ed6960b4e9f2e2caf33230d740df3269cf7c

Contents?: true

Size: 430 Bytes

Versions: 2

Compression:

Stored size: 430 Bytes

Contents

require 'test_helper'

class RecordTest < ActiveSupport::TestCase

  # NOTE: Callbacks not called in tests until rails 5
  test 'callbacks' do
    user = User.create(name: 'mike')
    user.cache
    key = "users/#{user.id}"
    assert_equal 'mike', $redis.get(key)

    user.update name: 'john'
    user.recache
    assert_equal 'john', $redis.get(key)

    user.destroy
    user.uncache
    assert_nil $redis.get(key)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cachers-0.1.1 test/record_test.rb
cachers-0.0.1 test/record_test.rb