Sha256: 9df4be0b7a02ab28d51a4a18062133b5614feaf981fec9e4261574ee23ed492d

Contents?: true

Size: 509 Bytes

Versions: 18

Compression:

Stored size: 509 Bytes

Contents

require 'test_helper'

class Superstore::CachingTest < Superstore::TestCase
  class ::OtherClass < Superstore::Base
  end

  test 'for a new record' do
    issue = Issue.new
    other_class = OtherClass.new
    assert_equal "issues/new", issue.cache_key
    assert_equal "other_classes/new", other_class.cache_key
  end

  test 'for a persisted record' do
    updated_at = Time.now
    issue = Issue.create!(id: 1, updated_at: updated_at)

    assert_equal "issues/1-#{updated_at}", issue.cache_key
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
superstore-2.0.1 test/unit/caching_test.rb
superstore-2.0.0 test/unit/caching_test.rb
superstore-1.2.0 test/unit/caching_test.rb
superstore-1.1.4 test/unit/caching_test.rb
superstore-1.1.3 test/unit/caching_test.rb
superstore-1.1.2 test/unit/caching_test.rb
superstore-1.1.1 test/unit/caching_test.rb
superstore-1.1.0 test/unit/caching_test.rb
superstore-1.0.12 test/unit/caching_test.rb
superstore-1.0.11 test/unit/caching_test.rb
superstore-1.0.10 test/unit/caching_test.rb
superstore-1.0.9 test/unit/caching_test.rb
superstore-1.0.8 test/unit/caching_test.rb
superstore-1.0.7 test/unit/caching_test.rb
superstore-1.0.6 test/unit/caching_test.rb
superstore-1.0.5 test/unit/caching_test.rb
superstore-1.0.4 test/unit/caching_test.rb
superstore-1.0.3 test/unit/caching_test.rb