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-11.2.0 test/test_validations.rb
composite_primary_keys-11.1.0 test/test_validations.rb
composite_primary_keys-11.0.3 test/test_validations.rb
composite_primary_keys-11.0.2 test/test_validations.rb
composite_primary_keys-10.0.5 test/test_validations.rb
composite_primary_keys-9.0.10 test/test_validations.rb
composite_primary_keys-11.0.1 test/test_validations.rb
composite_primary_keys-11.0.0 test/test_validations.rb
composite_primary_keys-10.0.4 test/test_validations.rb