Sha256: 7753a7a636a91510e61a230446f2a0fe1260c690403dc602ad33ab1eda8a0171

Contents?: true

Size: 513 Bytes

Versions: 28

Compression:

Stored size: 513 Bytes

Contents

require 'test_helper'

class CassandraObject::IdentityTest < CassandraObject::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

28 entries across 28 versions & 1 rubygems

Version Path
gotime-cassandra_object-4.5.1 test/unit/identity_test.rb
gotime-cassandra_object-4.5.0 test/unit/identity_test.rb
gotime-cassandra_object-4.4.5 test/unit/identity_test.rb
gotime-cassandra_object-4.4.4 test/unit/identity_test.rb
gotime-cassandra_object-4.4.3 test/unit/identity_test.rb
gotime-cassandra_object-4.4.0 test/unit/identity_test.rb
gotime-cassandra_object-4.3.2 test/unit/identity_test.rb
gotime-cassandra_object-4.3.1 test/unit/identity_test.rb
gotime-cassandra_object-4.3.0 test/unit/identity_test.rb
gotime-cassandra_object-4.2.2 test/unit/identity_test.rb
gotime-cassandra_object-4.2.0 test/unit/identity_test.rb
gotime-cassandra_object-4.1.0 test/unit/identity_test.rb
gotime-cassandra_object-4.0.2 test/unit/identity_test.rb
gotime-cassandra_object-4.0.1 test/unit/identity_test.rb
gotime-cassandra_object-4.0.0 test/unit/identity_test.rb
gotime-cassandra_object-3.0.5 test/unit/identity_test.rb
gotime-cassandra_object-3.0.4 test/unit/identity_test.rb
gotime-cassandra_object-3.0.3 test/unit/identity_test.rb
gotime-cassandra_object-3.0.2 test/unit/identity_test.rb
gotime-cassandra_object-3.0.1 test/unit/identity_test.rb