Sha256: f2a8e405be3ee546440084b12520532505746edb0273c6cf214688eef3d1a354

Contents?: true

Size: 1.05 KB

Versions: 20

Compression:

Stored size: 1.05 KB

Contents

require 'test_helper'

class CassandraObject::BaseTest < CassandraObject::TestCase
  class Son < CassandraObject::Base
  end

  class Grandson < Son
  end

  test 'base_class' do
    assert_equal Son, Son.base_class
    assert_equal Son, Grandson.base_class
  end

  test 'column family' do
    assert_equal 'CassandraObject::BaseTest::Sons', Son.column_family
    assert_equal 'CassandraObject::BaseTest::Sons', Grandson.column_family
  end

  test 'initialiaze' do
    issue = Issue.new
    
    assert issue.new_record?
    assert !issue.destroyed?
  end

  test 'equality of new records' do
    assert_not_equal Issue.new, Issue.new
  end

  test 'equality' do
    first_issue = Issue.create
    second_issue = Issue.create

    assert_equal first_issue, first_issue
    assert_equal first_issue, Issue.find(first_issue.id)
    assert_not_equal first_issue, second_issue
  end

  test 'to_param' do
    issue = Issue.create
    assert_equal issue.id, issue.to_param
  end
  
  test 'hash' do
    issue = Issue.create
    assert_equal issue.id.hash, issue.hash
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.12.0 test/unit/base_test.rb
gotime-cassandra_object-2.11.9 test/unit/base_test.rb
gotime-cassandra_object-2.11.8 test/unit/base_test.rb
gotime-cassandra_object-2.11.7 test/unit/base_test.rb
gotime-cassandra_object-2.11.6 test/unit/base_test.rb
gotime-cassandra_object-2.11.5 test/unit/base_test.rb
gotime-cassandra_object-2.11.4 test/unit/base_test.rb
gotime-cassandra_object-2.11.3 test/unit/base_test.rb
gotime-cassandra_object-2.11.2 test/unit/base_test.rb
gotime-cassandra_object-2.11.1 test/unit/base_test.rb
gotime-cassandra_object-2.11.0 test/unit/base_test.rb
gotime-cassandra_object-2.10.11 test/unit/base_test.rb
gotime-cassandra_object-2.10.10 test/unit/base_test.rb
gotime-cassandra_object-2.10.9 test/unit/base_test.rb
gotime-cassandra_object-2.10.8 test/unit/base_test.rb
gotime-cassandra_object-2.10.7 test/unit/base_test.rb
gotime-cassandra_object-2.10.6 test/unit/base_test.rb
gotime-cassandra_object-2.10.5 test/unit/base_test.rb
gotime-cassandra_object-2.10.4 test/unit/base_test.rb
gotime-cassandra_object-2.10.3 test/unit/base_test.rb