Sha256: bd6e6d4f684d3f9dec24a375459f1181b34f2332115d6556302679dd2f6ca329

Contents?: true

Size: 715 Bytes

Versions: 8

Compression:

Stored size: 715 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 3, Product.count
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
composite_primary_keys-3.1.11 test/test_miscellaneous.rb
composite_primary_keys-4.0.0.beta7 test/test_miscellaneous.rb
composite_primary_keys-4.0.0.beta6 test/test_miscellaneous.rb
composite_primary_keys-4.0.0.beta5 test/test_miscellaneous.rb
composite_primary_keys-4.0.0.beta4 test/test_miscellaneous.rb
composite_primary_keys-4.0.0.beta3 test/test_miscellaneous.rb
composite_primary_keys-3.1.10 test/test_miscellaneous.rb
composite_primary_keys-4.0.0.beta2 test/test_miscellaneous.rb