aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2018-01-24 22:04:11 -0500
committerDaniel Colson <danieljamescolson@gmail.com>2018-01-25 23:32:58 -0500
commit211adb47e76b358ea15a3f756431c042ab231c23 (patch)
treef688daea11af3dce588e3c5a9791722a2f3aaec5 /activerecord
parent0d50cae996c51630361e8514e1f168b0c48957e1 (diff)
downloadrails-211adb47e76b358ea15a3f756431c042ab231c23.tar.gz
rails-211adb47e76b358ea15a3f756431c042ab231c23.tar.bz2
rails-211adb47e76b358ea15a3f756431c042ab231c23.zip
Change refute to assert_not
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/adapters/postgresql/array_test.rb2
-rw-r--r--activerecord/test/cases/adapters/postgresql/hstore_test.rb4
-rw-r--r--activerecord/test/cases/attributes_test.rb4
-rw-r--r--activerecord/test/cases/base_test.rb2
-rw-r--r--activerecord/test/cases/dirty_test.rb14
-rw-r--r--activerecord/test/cases/locking_test.rb2
-rw-r--r--activerecord/test/cases/migration/foreign_key_test.rb10
-rw-r--r--activerecord/test/cases/migration/rename_table_test.rb4
-rw-r--r--activerecord/test/cases/query_cache_test.rb14
-rw-r--r--activerecord/test/cases/relation/merging_test.rb2
-rw-r--r--activerecord/test/cases/serialized_attribute_test.rb2
-rw-r--r--activerecord/test/cases/validations/uniqueness_validation_test.rb4
12 files changed, 32 insertions, 32 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb
index 7eecd5bc35..616651e19c 100644
--- a/activerecord/test/cases/adapters/postgresql/array_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/array_test.rb
@@ -257,7 +257,7 @@ class PostgresqlArrayTest < ActiveRecord::PostgreSQLTestCase
x = PgArray.create!(tags: tags)
x.reload
- refute x.changed?
+ assert_not x.changed?
end
def test_quoting_non_standard_delimiters
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
index 5be98e3293..22c939098a 100644
--- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
@@ -174,7 +174,7 @@ class PostgresqlHstoreTest < ActiveRecord::PostgreSQLTestCase
hstore.settings = { "key" => "value", "alongkey" => "anything" }
assert_equal settings, hstore.settings
- refute hstore.changed?
+ assert_not hstore.changed?
end
def test_hstore_dirty_from_database_equal
@@ -184,7 +184,7 @@ class PostgresqlHstoreTest < ActiveRecord::PostgreSQLTestCase
assert_equal settings, hstore.settings
hstore.settings = settings
- refute hstore.changed?
+ assert_not hstore.changed?
end
def test_gen1
diff --git a/activerecord/test/cases/attributes_test.rb b/activerecord/test/cases/attributes_test.rb
index 8ebfee61ff..cb46643de0 100644
--- a/activerecord/test/cases/attributes_test.rb
+++ b/activerecord/test/cases/attributes_test.rb
@@ -211,7 +211,7 @@ module ActiveRecord
end
test "attributes not backed by database columns are not dirty when unchanged" do
- refute OverloadedType.new.non_existent_decimal_changed?
+ assert_not OverloadedType.new.non_existent_decimal_changed?
end
test "attributes not backed by database columns are always initialized" do
@@ -251,7 +251,7 @@ module ActiveRecord
assert_equal "lol", model.foo
model.foo = "lol"
- refute model.changed?
+ assert_not model.changed?
end
test "attributes not backed by database columns appear in inspect" do
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index b236961dd9..9d398fc407 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -1490,7 +1490,7 @@ class BasicsTest < ActiveRecord::TestCase
query = Developer.all.to_sql.downcase
# ignored column
- refute query.include?("first_name")
+ assert_not query.include?("first_name")
# regular column
assert query.include?("name")
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index d4408776d3..5cb4aa3287 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -762,7 +762,7 @@ class DirtyTest < ActiveRecord::TestCase
test "attributes assigned but not selected are dirty" do
person = Person.select(:id).first
- refute person.changed?
+ assert_not person.changed?
person.first_name = "Sean"
assert person.changed?
@@ -782,13 +782,13 @@ class DirtyTest < ActiveRecord::TestCase
person = Person.create!(first_name: "Sean")
assert person.saved_change_to_first_name?
- refute person.saved_change_to_gender?
+ assert_not person.saved_change_to_gender?
assert person.saved_change_to_first_name?(from: nil, to: "Sean")
assert person.saved_change_to_first_name?(from: nil)
assert person.saved_change_to_first_name?(to: "Sean")
- refute person.saved_change_to_first_name?(from: "Jim", to: "Sean")
- refute person.saved_change_to_first_name?(from: "Jim")
- refute person.saved_change_to_first_name?(to: "Jim")
+ assert_not person.saved_change_to_first_name?(from: "Jim", to: "Sean")
+ assert_not person.saved_change_to_first_name?(from: "Jim")
+ assert_not person.saved_change_to_first_name?(to: "Jim")
end
test "saved_change_to_attribute returns the change that occurred in the last save" do
@@ -827,7 +827,7 @@ class DirtyTest < ActiveRecord::TestCase
person.save
- refute person.saved_changes?
+ assert_not person.saved_changes?
end
test "saved_changes returns a hash of all the changes that occurred" do
@@ -857,7 +857,7 @@ class DirtyTest < ActiveRecord::TestCase
end
person = klass.create!(first_name: "Sean")
- refute person.changed?
+ assert_not person.changed?
end
private
diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb
index 3701be4b11..bef28ded7f 100644
--- a/activerecord/test/cases/locking_test.rb
+++ b/activerecord/test/cases/locking_test.rb
@@ -532,7 +532,7 @@ class OptimisticLockingWithSchemaChangeTest < ActiveRecord::TestCase
stale_object.destroy!
end
- refute stale_object.destroyed?
+ assert_not stale_object.destroyed?
end
private
diff --git a/activerecord/test/cases/migration/foreign_key_test.rb b/activerecord/test/cases/migration/foreign_key_test.rb
index 079be04946..48a6dc6266 100644
--- a/activerecord/test/cases/migration/foreign_key_test.rb
+++ b/activerecord/test/cases/migration/foreign_key_test.rb
@@ -235,12 +235,12 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
assert_equal 1, foreign_keys.size
fk = foreign_keys.first
- refute fk.validated?
+ assert_not fk.validated?
end
def test_validate_foreign_key_infers_column
@connection.add_foreign_key :astronauts, :rockets, validate: false
- refute @connection.foreign_keys("astronauts").first.validated?
+ assert_not @connection.foreign_keys("astronauts").first.validated?
@connection.validate_foreign_key :astronauts, :rockets
assert @connection.foreign_keys("astronauts").first.validated?
@@ -248,7 +248,7 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
def test_validate_foreign_key_by_column
@connection.add_foreign_key :astronauts, :rockets, column: "rocket_id", validate: false
- refute @connection.foreign_keys("astronauts").first.validated?
+ assert_not @connection.foreign_keys("astronauts").first.validated?
@connection.validate_foreign_key :astronauts, column: "rocket_id"
assert @connection.foreign_keys("astronauts").first.validated?
@@ -256,7 +256,7 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
def test_validate_foreign_key_by_symbol_column
@connection.add_foreign_key :astronauts, :rockets, column: :rocket_id, validate: false
- refute @connection.foreign_keys("astronauts").first.validated?
+ assert_not @connection.foreign_keys("astronauts").first.validated?
@connection.validate_foreign_key :astronauts, column: :rocket_id
assert @connection.foreign_keys("astronauts").first.validated?
@@ -264,7 +264,7 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
def test_validate_foreign_key_by_name
@connection.add_foreign_key :astronauts, :rockets, column: "rocket_id", name: "fancy_named_fk", validate: false
- refute @connection.foreign_keys("astronauts").first.validated?
+ assert_not @connection.foreign_keys("astronauts").first.validated?
@connection.validate_foreign_key :astronauts, name: "fancy_named_fk"
assert @connection.foreign_keys("astronauts").first.validated?
diff --git a/activerecord/test/cases/migration/rename_table_test.rb b/activerecord/test/cases/migration/rename_table_test.rb
index dfce266253..8514ccd55b 100644
--- a/activerecord/test/cases/migration/rename_table_test.rb
+++ b/activerecord/test/cases/migration/rename_table_test.rb
@@ -86,7 +86,7 @@ module ActiveRecord
rename_table :cats, :felines
assert connection.table_exists? :felines
- refute connection.table_exists? :cats
+ assert_not connection.table_exists? :cats
primary_key_name = connection.select_values(<<-SQL.strip_heredoc, "SCHEMA")[0]
SELECT c.relname
@@ -107,7 +107,7 @@ module ActiveRecord
connection.create_table :cats, id: :uuid, default: "uuid_generate_v4()"
assert_nothing_raised { rename_table :cats, :felines }
assert connection.table_exists? :felines
- refute connection.table_exists? :cats
+ assert_not connection.table_exists? :cats
ensure
connection.drop_table :cats, if_exists: true
connection.drop_table :felines, if_exists: true
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb
index ad05f70933..e66d7a6b33 100644
--- a/activerecord/test/cases/query_cache_test.rb
+++ b/activerecord/test/cases/query_cache_test.rb
@@ -327,7 +327,7 @@ class QueryCacheTest < ActiveRecord::TestCase
conf = ActiveRecord::Base.configurations["arunit"].merge("name" => "test2")
ActiveRecord::Base.connection_handler.establish_connection(conf)
Task.connection_specification_name = "test2"
- refute Task.connected?
+ assert_not Task.connected?
Task.cache do
begin
@@ -414,20 +414,20 @@ class QueryCacheTest < ActiveRecord::TestCase
def test_query_cache_does_not_establish_connection_if_unconnected
with_temporary_connection_pool do
ActiveRecord::Base.clear_active_connections!
- refute ActiveRecord::Base.connection_handler.active_connections? # sanity check
+ assert_not ActiveRecord::Base.connection_handler.active_connections? # sanity check
middleware {
- refute ActiveRecord::Base.connection_handler.active_connections?, "QueryCache forced ActiveRecord::Base to establish a connection in setup"
+ assert_not ActiveRecord::Base.connection_handler.active_connections?, "QueryCache forced ActiveRecord::Base to establish a connection in setup"
}.call({})
- refute ActiveRecord::Base.connection_handler.active_connections?, "QueryCache forced ActiveRecord::Base to establish a connection in cleanup"
+ assert_not ActiveRecord::Base.connection_handler.active_connections?, "QueryCache forced ActiveRecord::Base to establish a connection in cleanup"
end
end
def test_query_cache_is_enabled_on_connections_established_after_middleware_runs
with_temporary_connection_pool do
ActiveRecord::Base.clear_active_connections!
- refute ActiveRecord::Base.connection_handler.active_connections? # sanity check
+ assert_not ActiveRecord::Base.connection_handler.active_connections? # sanity check
middleware {
assert ActiveRecord::Base.connection.query_cache_enabled, "QueryCache did not get lazily enabled"
@@ -444,8 +444,8 @@ class QueryCacheTest < ActiveRecord::TestCase
assert ActiveRecord::Base.connection.query_cache_enabled
Thread.new {
- refute ActiveRecord::Base.connection_pool.query_cache_enabled
- refute ActiveRecord::Base.connection.query_cache_enabled
+ assert_not ActiveRecord::Base.connection_pool.query_cache_enabled
+ assert_not ActiveRecord::Base.connection.query_cache_enabled
}.join
}.call({})
diff --git a/activerecord/test/cases/relation/merging_test.rb b/activerecord/test/cases/relation/merging_test.rb
index f31df40c91..e699b4176a 100644
--- a/activerecord/test/cases/relation/merging_test.rb
+++ b/activerecord/test/cases/relation/merging_test.rb
@@ -115,7 +115,7 @@ class RelationMergingTest < ActiveRecord::TestCase
relation = Post.all
assert relation.from_clause.empty?
relation = relation.merge(Post.from("posts"))
- refute relation.from_clause.empty?
+ assert_not relation.from_clause.empty?
end
end
diff --git a/activerecord/test/cases/serialized_attribute_test.rb b/activerecord/test/cases/serialized_attribute_test.rb
index 32dafbd458..8d6f196b94 100644
--- a/activerecord/test/cases/serialized_attribute_test.rb
+++ b/activerecord/test/cases/serialized_attribute_test.rb
@@ -349,7 +349,7 @@ class SerializedAttributeTest < ActiveRecord::TestCase
topic = model.create!(foo: "bar")
topic.foo
- refute topic.changed?
+ assert_not topic.changed?
end
def test_serialized_attribute_works_under_concurrent_initial_access
diff --git a/activerecord/test/cases/validations/uniqueness_validation_test.rb b/activerecord/test/cases/validations/uniqueness_validation_test.rb
index a10567f066..82dfeeb037 100644
--- a/activerecord/test/cases/validations/uniqueness_validation_test.rb
+++ b/activerecord/test/cases/validations/uniqueness_validation_test.rb
@@ -530,7 +530,7 @@ class UniquenessValidationTest < ActiveRecord::TestCase
assert topic.author_name.start_with?("Title1")
topic2 = TopicWithAfterCreate.new(title: "Title1")
- refute topic2.valid?
+ assert_not topic2.valid?
assert_equal(["has already been taken"], topic2.errors[:title])
end
@@ -550,7 +550,7 @@ class UniquenessValidationTest < ActiveRecord::TestCase
assert_empty item.errors
item2 = CoolTopic.new(id: item.id, title: "MyItem2")
- refute item2.valid?
+ assert_not item2.valid?
assert_equal(["has already been taken"], item2.errors[:id])
end