Ticket #11529: test_validate_uniqueness_with_columns_which_are_sql_keywords.diff
| File test_validate_uniqueness_with_columns_which_are_sql_keywords.diff, 1.4 kB (added by maccman, 6 months ago) |
|---|
-
test/schema/schema.rb
old new 202 202 t.integer :parent_id 203 203 t.string :type 204 204 end 205 206 create_table :guids, :force => true do |t| 207 t.string :key 208 end 205 209 206 210 207 211 -
test/models/guid.rb
old new 1 class Guid < ActiveRecord::Base 2 end -
test/cases/validations_test.rb
old new 5 5 require 'models/person' 6 6 require 'models/developer' 7 7 require 'models/warehouse_thing' 8 require 'models/guid' 8 9 9 10 # The following methods in Topic are used in test_conditional_validation_* 10 11 class Topic … … 459 460 assert !t3.errors.on(:parent_id) 460 461 assert_not_equal "has already been taken", t3.errors.on(:title) 461 462 end 463 464 def test_validate_uniqueness_with_columns_which_are_sql_keywords 465 Guid.validates_uniqueness_of :key 466 g = Guid.new 467 g.key = "foo" 468 assert_nothing_raised { !g.valid? } 469 end 462 470 463 471 def test_validate_uniqueness_with_non_standard_table_names 464 472 i1 = WarehouseThing.create(:value => 1000)