Sha256: 95ed5e414e713fa8ea2ceb73b01214d2752d0084969ed7cf6e569cf35fd53d64

Contents?: true

Size: 714 Bytes

Versions: 10

Compression:

Stored size: 714 Bytes

Contents

require 'abstract_unit'

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

10 entries across 10 versions & 1 rubygems

Version Path
composite_primary_keys-4.0.0.beta1 test/test_miscellaneous.rb
composite_primary_keys-3.1.9 test/test_miscellaneous.rb
composite_primary_keys-3.1.8 test/test_miscellaneous.rb
composite_primary_keys-3.1.7 test/test_miscellaneous.rb
composite_primary_keys-3.1.6 test/test_miscellaneous.rb
composite_primary_keys-3.1.5 test/test_miscellaneous.rb
composite_primary_keys-3.1.4 test/test_miscellaneous.rb
composite_primary_keys-3.1.2 test/test_miscellaneous.rb
composite_primary_keys-3.1.1 test/test_miscellaneous.rb
composite_primary_keys-3.1.0 test/test_miscellaneous.rb