1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test to verify named unique index, when creating reference via add_reference

This commit is contained in:
Vipul A M 2016-04-16 20:44:08 +05:30
parent 39e087cbf5
commit ddb4636d24

View file

@ -55,6 +55,11 @@ module ActiveRecord
assert index_exists?(table_name, :tag_id, name: 'index_taggings_on_tag_id')
end
def test_creates_named_unique_index
add_reference table_name, :tag, index: { name: 'index_taggings_on_tag_id', unique: true }
assert index_exists?(table_name, :tag_id, name: 'index_taggings_on_tag_id', unique: true )
end
def test_creates_reference_id_with_specified_type
add_reference table_name, :user, type: :string
assert column_exists?(table_name, :user_id, :string)