Sha256: 35aae578584684b0a66776efbbc7b01e0435ccffe5963e5cc74ee79f3928037c

Contents?: true

Size: 441 Bytes

Versions: 29

Compression:

Stored size: 441 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

29 entries across 29 versions & 1 rubygems

Version Path
composite_primary_keys-13.0.1 test/test_validations.rb
composite_primary_keys-13.0.0 test/test_validations.rb
composite_primary_keys-12.0.10 test/test_validations.rb
composite_primary_keys-12.0.9 test/test_validations.rb
composite_primary_keys-12.0.8 test/test_validations.rb
composite_primary_keys-12.0.6 test/test_validations.rb
composite_primary_keys-12.0.5 test/test_validations.rb
composite_primary_keys-12.0.4 test/test_validations.rb
composite_primary_keys-12.0.3 test/test_validations.rb
composite_primary_keys-12.0.2 test/test_validations.rb
composite_primary_keys-11.3.1 test/test_validations.rb
composite_primary_keys-8.1.8 test/test_validations.rb
composite_primary_keys-12.0.1 test/test_validations.rb
composite_primary_keys-12.0.0 test/test_validations.rb
composite_primary_keys-12.0.0.rc5 test/test_validations.rb
composite_primary_keys-12.0.0.rc4 test/test_validations.rb
composite_primary_keys-12.0.0.rc3 test/test_validations.rb
composite_primary_keys-12.0.0.rc2 test/test_validations.rb
composite_primary_keys-12.0.0.rc1 test/test_validations.rb
composite_primary_keys-8.1.7 test/test_validations.rb