diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-04-25 07:54:56 +0900 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-29 17:52:37 -0700 |
commit | 2db8514d218068cae7b37b7939ed3ba812407105 (patch) | |
tree | 9af6677a1012c6c13c61c1e6119b31cb0f36cf98 /activerecord/test | |
parent | 7fc4979d4dab63591dcbf75367c496cbfa2881ce (diff) | |
download | rails-2db8514d218068cae7b37b7939ed3ba812407105.tar.gz rails-2db8514d218068cae7b37b7939ed3ba812407105.tar.bz2 rails-2db8514d218068cae7b37b7939ed3ba812407105.zip |
Treat blank comments as no comment for indexes
Follow up of 1683410.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/comment_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/test/cases/comment_test.rb b/activerecord/test/cases/comment_test.rb index 37d951ad88..839fdbe578 100644 --- a/activerecord/test/cases/comment_test.rb +++ b/activerecord/test/cases/comment_test.rb @@ -5,7 +5,6 @@ if ActiveRecord::Base.connection.supports_comments? class CommentTest < ActiveRecord::TestCase include SchemaDumpingHelper - self.use_transactional_tests = false if current_adapter?(:Mysql2Adapter) class Commented < ActiveRecord::Base self.table_name = 'commenteds' @@ -29,6 +28,10 @@ class CommentTest < ActiveRecord::TestCase t.string :empty_comment, comment: '' t.string :nil_comment, comment: nil t.string :absent_comment + t.index :space_comment, comment: ' ' + t.index :empty_comment, comment: '' + t.index :nil_comment, comment: nil + t.index :absent_comment end Commented.reset_column_information @@ -54,6 +57,12 @@ class CommentTest < ActiveRecord::TestCase end end + def test_blank_indexes_created_in_block + @connection.indexes('blank_comments').each do |index| + assert_nil index.comment + end + end + def test_add_column_with_comment_later @connection.add_column :commenteds, :rating, :integer, comment: 'I am running out of imagination' Commented.reset_column_information |