Sha256: cec7b2fd6b5a6a68e1932f7b93011e8e0134ad4617e878c672839d0e627c7926

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

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

class MiscellaneousTest < Test::Unit::TestCase
  fixtures :reference_types, :reference_codes
  
  CLASSES = {
    :single => {
      :class => ReferenceType,
      :primary_keys => [:reference_type_id],
    },
    :dual   => { 
      :class => ReferenceCode,
      :primary_keys => [:reference_type_id, :reference_code],
    },
  }
  
  def setup
    super
    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

2 entries across 2 versions & 1 rubygems

Version Path
composite_primary_keys-0.6.0 test/miscellaneous_test.rb
composite_primary_keys-0.6.1 test/miscellaneous_test.rb