aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/ar_schema_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/ar_schema_test.rb')
-rw-r--r--activerecord/test/cases/ar_schema_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/cases/ar_schema_test.rb b/activerecord/test/cases/ar_schema_test.rb
index f05dcac7dd..8e796a6f13 100644
--- a/activerecord/test/cases/ar_schema_test.rb
+++ b/activerecord/test/cases/ar_schema_test.rb
@@ -116,8 +116,8 @@ class ActiveRecordSchemaTest < ActiveRecord::TestCase
end
end
- assert_not @connection.columns(:has_timestamps).find { |c| c.name == "created_at" }.null
- assert_not @connection.columns(:has_timestamps).find { |c| c.name == "updated_at" }.null
+ assert @connection.column_exists?(:has_timestamps, :created_at, null: false)
+ assert @connection.column_exists?(:has_timestamps, :updated_at, null: false)
end
def test_timestamps_without_null_set_null_to_false_on_change_table
@@ -129,8 +129,8 @@ class ActiveRecordSchemaTest < ActiveRecord::TestCase
end
end
- assert_not @connection.columns(:has_timestamps).find { |c| c.name == "created_at" }.null
- assert_not @connection.columns(:has_timestamps).find { |c| c.name == "updated_at" }.null
+ assert @connection.column_exists?(:has_timestamps, :created_at, null: false)
+ assert @connection.column_exists?(:has_timestamps, :updated_at, null: false)
end
def test_timestamps_without_null_set_null_to_false_on_add_timestamps
@@ -139,7 +139,7 @@ class ActiveRecordSchemaTest < ActiveRecord::TestCase
add_timestamps :has_timestamps, default: Time.now
end
- assert_not @connection.columns(:has_timestamps).find { |c| c.name == "created_at" }.null
- assert_not @connection.columns(:has_timestamps).find { |c| c.name == "updated_at" }.null
+ assert @connection.column_exists?(:has_timestamps, :created_at, null: false)
+ assert @connection.column_exists?(:has_timestamps, :updated_at, null: false)
end
end