Sha256: 74696483021d81fd7c38e496e5df977ca607cb7272a9fff21ab86cd650d229f1

Contents?: true

Size: 826 Bytes

Versions: 7

Compression:

Stored size: 826 Bytes

Contents

require 'abstract_unit'
require 'fixtures/reference_type'
require 'fixtures/reference_code'

class TestMiscellaneous < Test::Unit::TestCase
  
  CLASSES = {
    :single => {
      :class => ReferenceType,
      :primary_keys => :reference_type_id,
    },
    :dual   => { 
      :class => ReferenceCode,
      :primary_keys => [:reference_type_id, :reference_code],
    },
  }
  
  def setup
    create_fixtures :reference_types, :reference_codes, :products
    self.class.classes = CLASSES
  end

  def test_composite_class
    testing_with do
      assert_equal composite?, @klass.composite?
    end
  end

  def test_composite_instance
    testing_with do
      assert_equal composite?, @first.composite?
    end
  end
  
  def test_count
    assert_equal 2, Product.count
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
composite_primary_keys-0.8.0 test/test_miscellaneous.rb
composite_primary_keys-0.8.2 test/test_miscellaneous.rb
composite_primary_keys-0.8.6 test/test_miscellaneous.rb
composite_primary_keys-0.8.3 test/test_miscellaneous.rb
composite_primary_keys-0.8.5 test/test_miscellaneous.rb
composite_primary_keys-0.9.0 test/test_miscellaneous.rb
composite_primary_keys-0.8.4 test/test_miscellaneous.rb