Sha256: 48e190d4c9da339f24d22ff8b6a3c0f368dfc4c2d175ff0451ff2df931586579

Contents?: true

Size: 715 Bytes

Versions: 29

Compression:

Stored size: 715 Bytes

Contents

require File.expand_path('../abstract_unit', __FILE__)

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
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
composite_primary_keys-11.2.0 test/test_miscellaneous.rb
composite_primary_keys-11.1.0 test/test_miscellaneous.rb
composite_primary_keys-11.0.3 test/test_miscellaneous.rb
composite_primary_keys-11.0.2 test/test_miscellaneous.rb
composite_primary_keys-10.0.5 test/test_miscellaneous.rb
composite_primary_keys-9.0.10 test/test_miscellaneous.rb
composite_primary_keys-11.0.1 test/test_miscellaneous.rb
composite_primary_keys-11.0.0 test/test_miscellaneous.rb
composite_primary_keys-10.0.4 test/test_miscellaneous.rb