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-8.1.2 test/test_validations.rb
composite_primary_keys-7.0.16 test/test_validations.rb
composite_primary_keys-7.0.15 test/test_validations.rb
composite_primary_keys-8.1.1 test/test_validations.rb
composite_primary_keys-7.0.14 test/test_validations.rb
composite_primary_keys-8.1.0 test/test_validations.rb
composite_primary_keys-7.0.13 test/test_validations.rb
composite_primary_keys-6.0.8 test/test_validations.rb
composite_primary_keys-8.0.0 test/test_validations.rb
composite_primary_keys-7.0.12 test/test_validations.rb
composite_primary_keys-7.0.11 test/test_validations.rb
composite_primary_keys-6.0.7 test/test_validations.rb
composite_primary_keys-7.0.10 test/test_validations.rb
composite_primary_keys-7.0.9 test/test_validations.rb
composite_primary_keys-7.0.8 test/test_validations.rb
composite_primary_keys-7.0.7 test/test_validations.rb
composite_primary_keys-7.0.6 test/test_validations.rb
composite_primary_keys-7.0.5 test/test_validations.rb
composite_primary_keys-7.0.4 test/test_validations.rb
composite_primary_keys-7.0.3 test/test_validations.rb