Sha256: 460b9e6984b3e356a409c0d73e1dade4ad2f3005d42321cf67c27d716c247daa

Contents?: true

Size: 514 Bytes

Versions: 48

Compression:

Stored size: 514 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

48 entries across 48 versions & 3 rubygems

Version Path
extendi-cassandra_object-1.1.1 test/unit/identity_test.rb
extendi-cassandra_object-1.1.0 test/unit/identity_test.rb
extendi-cassandra_object-1.0.20 test/unit/identity_test.rb
extendi-cassandra_object-1.0.19 test/unit/identity_test.rb
extendi-cassandra_object-1.0.18 test/unit/identity_test.rb
extendi-cassandra_object-1.0.17 test/unit/identity_test.rb
extendi-cassandra_object-1.0.16 test/unit/identity_test.rb
extendi-cassandra_object-1.0.15 test/unit/identity_test.rb
extendi-cassandra_object-1.0.14 test/unit/identity_test.rb
extendi-cassandra_object-1.0.13 test/unit/identity_test.rb
extendi-cassandra_object-1.0.12 test/unit/identity_test.rb
extendi-cassandra_object-1.0.11 test/unit/identity_test.rb
extendi-cassandra_object-1.0.10 test/unit/identity_test.rb
extendi-cassandra_object-1.0.9 test/unit/identity_test.rb
extendi-cassandra_object-1.0.8 test/unit/identity_test.rb
extendi-cassandra_object-1.0.7 test/unit/identity_test.rb
extendi-cassandra_object-1.0.6 test/unit/identity_test.rb
extendi-cassandra_object-1.0.5 test/unit/identity_test.rb
extendi-cassandra_object-1.0.4 test/unit/identity_test.rb
extendi-cassandra_object-1.0.1 test/unit/identity_test.rb