Sha256: ebb7ff30fe3dcbe03ab8ae9d41cd2efe11e08a5c6cc541b7cb6562526fc4d4b8

Contents?: true

Size: 504 Bytes

Versions: 33

Compression:

Stored size: 504 Bytes

Contents

require 'test_helper'

class Superstore::IdentityTest < Superstore::TestCase
  test 'primary_key' do
    assert_equal 'id', Issue.primary_key
  end

  test 'default _generate_key' do
    issue = Issue.new

    assert_not_nil Issue._generate_key(issue)
  end

  test 'custom key' do
    model = temp_object do
      key do
        "name:#{name}"
      end
      attr_accessor :name
    end
    record = model.new
    record.name = 'bar'

    assert_equal 'name:bar', model._generate_key(record)
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
superstore-3.0.0 test/unit/identity_test.rb
superstore-2.5.0 test/unit/identity_test.rb
superstore-2.4.4 test/unit/identity_test.rb
superstore-2.4.3 test/unit/identity_test.rb
superstore-2.4.2 test/unit/identity_test.rb
superstore-2.4.1 test/unit/identity_test.rb
superstore-2.4.0 test/unit/identity_test.rb
superstore-2.3.0 test/unit/identity_test.rb
superstore-2.2.0 test/unit/identity_test.rb
superstore-2.1.3 test/unit/identity_test.rb
superstore-2.1.2 test/unit/identity_test.rb
superstore-2.1.1 test/unit/identity_test.rb
superstore-2.1.0 test/unit/identity_test.rb
superstore-2.0.1 test/unit/identity_test.rb
superstore-2.0.0 test/unit/identity_test.rb
superstore-1.2.0 test/unit/identity_test.rb
superstore-1.1.4 test/unit/identity_test.rb
superstore-1.1.3 test/unit/identity_test.rb
superstore-1.1.2 test/unit/identity_test.rb
superstore-1.1.1 test/unit/identity_test.rb