diff options
author | Étienne Barrié <etienne.barrie@gmail.com> | 2010-09-27 20:59:45 +0200 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-28 10:06:57 -0700 |
commit | 8b8730e1390963a8bb3a231ed1a324862d3dc4cf (patch) | |
tree | 89ec83c98304d4107ae2f341c4ea155e084c0931 /activerecord/test | |
parent | 9eca11a4a564f44675cca951216e917b8f610eab (diff) | |
download | rails-8b8730e1390963a8bb3a231ed1a324862d3dc4cf.tar.gz rails-8b8730e1390963a8bb3a231ed1a324862d3dc4cf.tar.bz2 rails-8b8730e1390963a8bb3a231ed1a324862d3dc4cf.zip |
Test add_index and remove_index with a symbol name #4891
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 8c75500998..5242d78033 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -124,6 +124,13 @@ if ActiveRecord::Base.connection.supports_migrations? end end + def test_index_symbol_names + assert_nothing_raised { Person.connection.add_index :people, :primary_contact_id, :name => :symbol_index_name } + assert Person.connection.index_exists?(:people, :primary_contact_id, :name => :symbol_index_name) + assert_nothing_raised { Person.connection.remove_index :people, :name => :symbol_index_name } + assert !Person.connection.index_exists?(:people, :primary_contact_id, :name => :symbol_index_name) + end + def test_add_index_length_limit good_index_name = 'x' * Person.connection.index_name_length too_long_index_name = good_index_name + 'x' |