Sha256: 5b74dc94b347dc1cce92c4f46f4bf3a223ec2659af707e9d4bbe03714f3f1ccb

Contents?: true

Size: 428 Bytes

Versions: 75

Compression:

Stored size: 428 Bytes

Contents

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

class TestValidations < ActiveSupport::TestCase
  fixtures :students, :dorms, :rooms, :room_assignments

  def test_uniqueness_validation_persisted
    room_assignment = RoomAssignment.find([1, 1, 1])
    assert(room_assignment.valid?)

    room_assignment = RoomAssignment.new(:student_id => 1, :dorm_id => 1, :room_id => 2)
    assert(!room_assignment.valid?)
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
composite_primary_keys-14.0.9 test/test_validations.rb
composite_primary_keys-14.0.8 test/test_validations.rb
composite_primary_keys-13.0.8 test/test_validations.rb
composite_primary_keys-14.0.7 test/test_validations.rb
composite_primary_keys-14.0.6 test/test_validations.rb
composite_primary_keys-13.0.7 test/test_validations.rb
composite_primary_keys-13.0.6 test/test_validations.rb
composite_primary_keys-14.0.5 test/test_validations.rb
composite_primary_keys-13.0.5 test/test_validations.rb
composite_primary_keys-13.0.4 test/test_validations.rb
composite_primary_keys-14.0.4 test/test_validations.rb
composite_primary_keys-14.0.3 test/test_validations.rb
composite_primary_keys-13.0.3 test/test_validations.rb
composite_primary_keys-14.0.2 test/test_validations.rb
composite_primary_keys-13.0.2 test/test_validations.rb
composite_primary_keys-14.0.1 test/test_validations.rb
composite_primary_keys-9.0.9 test/test_validations.rb
composite_primary_keys-11.0.0.rc2 test/test_validations.rb
composite_primary_keys-10.0.3 test/test_validations.rb
composite_primary_keys-11.0.0.rc1 test/test_validations.rb