aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/index_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/migration/index_test.rb')
-rw-r--r--activerecord/test/cases/migration/index_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/migration/index_test.rb b/activerecord/test/cases/migration/index_test.rb
index 26d7aeb148..89cf0f5e93 100644
--- a/activerecord/test/cases/migration/index_test.rb
+++ b/activerecord/test/cases/migration/index_test.rb
@@ -55,7 +55,7 @@ module ActiveRecord
assert_raise(ArgumentError) { connection.remove_index(table_name, "no_such_index") }
end
- def test_add_index_length_limit
+ def test_add_index_name_length_limit
good_index_name = 'x' * connection.index_name_length
too_long_index_name = good_index_name + 'x'
@@ -103,6 +103,12 @@ module ActiveRecord
assert connection.index_exists?(:testings, :foo, :name => "custom_index_name")
end
+ def test_add_index_attribute_length_limit
+ connection.add_index :testings, [:foo, :bar], :length => {:foo => 10, :bar => nil}
+
+ assert connection.index_exists?(:testings, [:foo, :bar])
+ end
+
def test_add_index
connection.add_index("testings", "last_name")
connection.remove_index("testings", "last_name")