Sha256: 98a20771d7e8adba7df7709e8ce0a39ae2b1514813ca334e01482f8127a31a55

Contents?: true

Size: 817 Bytes

Versions: 8

Compression:

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

8 entries across 8 versions & 1 rubygems

Version Path
composite_primary_keys-0.6.2 test/miscellaneous_test.rb
composite_primary_keys-0.6.3 test/miscellaneous_test.rb
composite_primary_keys-0.7.0 test/miscellaneous_test.rb
composite_primary_keys-0.7.1 test/miscellaneous_test.rb
composite_primary_keys-0.7.5 test/miscellaneous_test.rb
composite_primary_keys-0.7.4 test/miscellaneous_test.rb
composite_primary_keys-0.7.2 test/miscellaneous_test.rb
composite_primary_keys-0.7.3 test/miscellaneous_test.rb