aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapters/postgresql/array_test.rb8
-rw-r--r--activerecord/test/cases/adapters/sqlite3/quoting_test.rb14
-rw-r--r--activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb4
-rw-r--r--activerecord/test/cases/bind_parameter_test.rb4
-rw-r--r--activerecord/test/cases/calculations_test.rb12
-rw-r--r--activerecord/test/cases/fixtures_test.rb14
-rw-r--r--activerecord/test/cases/integration_test.rb15
-rw-r--r--activerecord/test/cases/migration_test.rb10
-rw-r--r--activerecord/test/cases/relation/delegation_test.rb16
-rw-r--r--activerecord/test/cases/sanitize_test.rb6
-rw-r--r--activerecord/test/cases/scoping/named_scoping_test.rb7
-rw-r--r--activerecord/test/cases/transactions_test.rb11
12 files changed, 7 insertions, 114 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb
index 42618c2ec3..b12055a40a 100644
--- a/activerecord/test/cases/adapters/postgresql/array_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/array_test.rb
@@ -226,14 +226,6 @@ class PostgresqlArrayTest < ActiveRecord::PostgreSQLTestCase
assert_equal(PgArray.last.tags, tag_values)
end
- def test_insert_fixtures
- tag_values = ["val1", "val2", "val3_with_'_multiple_quote_'_chars"]
- assert_deprecated do
- @connection.insert_fixtures([{ "tags" => tag_values }], "pg_arrays")
- end
- assert_equal(PgArray.last.tags, tag_values)
- end
-
def test_attribute_for_inspect_for_array_field
record = PgArray.new { |a| a.ratings = (1..10).to_a }
assert_equal("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", record.attribute_for_inspect(:ratings))
diff --git a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb
index 40b58e86bf..9d26f32102 100644
--- a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb
+++ b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb
@@ -6,12 +6,8 @@ require "securerandom"
class SQLite3QuotingTest < ActiveRecord::SQLite3TestCase
def setup
+ super
@conn = ActiveRecord::Base.connection
- @initial_represent_boolean_as_integer = ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer
- end
-
- def teardown
- ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer = @initial_represent_boolean_as_integer
end
def test_type_cast_binary_encoding_without_logger
@@ -22,18 +18,10 @@ class SQLite3QuotingTest < ActiveRecord::SQLite3TestCase
end
def test_type_cast_true
- ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer = false
- assert_equal "t", @conn.type_cast(true)
-
- ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer = true
assert_equal 1, @conn.type_cast(true)
end
def test_type_cast_false
- ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer = false
- assert_equal "f", @conn.type_cast(false)
-
- ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer = true
assert_equal 0, @conn.type_cast(false)
end
diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
index 56ceb45040..5c41c14171 100644
--- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
+++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
@@ -536,10 +536,6 @@ module ActiveRecord
end
end
- def test_deprecate_valid_alter_table_type
- assert_deprecated { @conn.valid_alter_table_type?(:string) }
- end
-
def test_db_is_not_readonly_when_readonly_option_is_false
conn = Base.sqlite3_connection database: ":memory:",
adapter: "sqlite3",
diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb
index bd5f157ca1..22a98036f3 100644
--- a/activerecord/test/cases/bind_parameter_test.rb
+++ b/activerecord/test/cases/bind_parameter_test.rb
@@ -77,10 +77,6 @@ if ActiveRecord::Base.connection.prepared_statements
assert_logs_binds(binds)
end
- def test_deprecate_supports_statement_cache
- assert_deprecated { ActiveRecord::Base.connection.supports_statement_cache? }
- end
-
private
def assert_logs_binds(binds)
payload = {
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index ade6b9e832..7af26d8ff5 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -917,15 +917,15 @@ class CalculationsTest < ActiveRecord::TestCase
assert_equal({ "proposed" => 2, "published" => 2 }, Book.group(:status).count)
end
- def test_deprecate_count_with_block_and_column_name
- assert_deprecated do
- assert_equal 6, Account.count(:firm_id) { true }
+ def test_count_with_block_and_column_name_raises_an_error
+ assert_raises(ArgumentError) do
+ Account.count(:firm_id) { true }
end
end
- def test_deprecate_sum_with_block_and_column_name
- assert_deprecated do
- assert_equal 6, Account.sum(:firm_id) { 1 }
+ def test_sum_with_block_and_column_name_raises_an_error
+ assert_raises(ArgumentError) do
+ Account.sum(:firm_id) { 1 }
end
end
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index 32021c5ebd..2fe4879fe6 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -301,20 +301,6 @@ class FixturesTest < ActiveRecord::TestCase
assert_equal fixtures, result.to_a
end
- def test_deprecated_insert_fixtures
- fixtures = [
- { "name" => "first", "wheels_count" => 2 },
- { "name" => "second", "wheels_count" => 3 }
- ]
- conn = ActiveRecord::Base.connection
- conn.delete("DELETE FROM aircraft")
- assert_deprecated do
- conn.insert_fixtures(fixtures, "aircraft")
- end
- result = conn.select_all("SELECT name, wheels_count FROM aircraft ORDER BY id")
- assert_equal fixtures, result.to_a
- end
-
def test_broken_yaml_exception
badyaml = Tempfile.new ["foo", ".yml"]
badyaml.write "a: : "
diff --git a/activerecord/test/cases/integration_test.rb b/activerecord/test/cases/integration_test.rb
index 5687afbc71..4185e8d682 100644
--- a/activerecord/test/cases/integration_test.rb
+++ b/activerecord/test/cases/integration_test.rb
@@ -191,21 +191,6 @@ class IntegrationTest < ActiveRecord::TestCase
end
end
- def test_named_timestamps_for_cache_key
- assert_deprecated do
- owner = owners(:blackbeard)
- assert_equal "owners/#{owner.id}-#{owner.happy_at.utc.to_s(:usec)}", owner.cache_key(:updated_at, :happy_at)
- end
- end
-
- def test_cache_key_when_named_timestamp_is_nil
- assert_deprecated do
- owner = owners(:blackbeard)
- owner.happy_at = nil
- assert_equal "owners/#{owner.id}", owner.cache_key(:happy_at)
- end
- end
-
def test_cache_key_is_stable_with_versioning_on
with_cache_versioning do
developer = Developer.first
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index a38a853d4f..46e2ff79d9 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -78,16 +78,6 @@ class MigrationTest < ActiveRecord::TestCase
end
end
- def test_migrator_migrations_path_is_deprecated
- assert_deprecated do
- ActiveRecord::Migrator.migrations_path = "/whatever"
- end
- ensure
- assert_deprecated do
- ActiveRecord::Migrator.migrations_path = "db/migrate"
- end
- end
-
def test_migration_version_matches_component_version
assert_equal ActiveRecord::VERSION::STRING.to_f, ActiveRecord::Migration.current_version
end
diff --git a/activerecord/test/cases/relation/delegation_test.rb b/activerecord/test/cases/relation/delegation_test.rb
index a8030c2d64..b600c999a6 100644
--- a/activerecord/test/cases/relation/delegation_test.rb
+++ b/activerecord/test/cases/relation/delegation_test.rb
@@ -23,23 +23,8 @@ module ActiveRecord
end
end
- module DeprecatedArelDelegationTests
- AREL_METHODS = [
- :with, :orders, :froms, :project, :projections, :taken, :constraints, :exists, :locked, :where_sql,
- :ast, :source, :join_sources, :to_dot, :create_insert, :create_true, :create_false
- ]
-
- def test_deprecate_arel_delegation
- AREL_METHODS.each do |method|
- assert_deprecated { target.public_send(method) }
- assert_deprecated { target.public_send(method) }
- end
- end
- end
-
class DelegationAssociationTest < ActiveRecord::TestCase
include ArrayDelegationTests
- include DeprecatedArelDelegationTests
def target
Post.new.comments
@@ -48,7 +33,6 @@ module ActiveRecord
class DelegationRelationTest < ActiveRecord::TestCase
include ArrayDelegationTests
- include DeprecatedArelDelegationTests
def target
Comment.all
diff --git a/activerecord/test/cases/sanitize_test.rb b/activerecord/test/cases/sanitize_test.rb
index 778cf86ac3..18b27bd6d1 100644
--- a/activerecord/test/cases/sanitize_test.rb
+++ b/activerecord/test/cases/sanitize_test.rb
@@ -168,12 +168,6 @@ class SanitizeTest < ActiveRecord::TestCase
assert_equal "#{ActiveRecord::Base.connection.quote('10')}::integer '2009-01-01'::date", l.call
end
- def test_deprecated_expand_hash_conditions_for_aggregates
- assert_deprecated do
- assert_equal({ "balance" => 50 }, Customer.send(:expand_hash_conditions_for_aggregates, balance: Money.new(50)))
- end
- end
-
private
def bind(statement, *vars)
if vars.first.is_a?(Hash)
diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb
index f707951a16..418a2ae04e 100644
--- a/activerecord/test/cases/scoping/named_scoping_test.rb
+++ b/activerecord/test/cases/scoping/named_scoping_test.rb
@@ -303,13 +303,6 @@ class NamedScopingTest < ActiveRecord::TestCase
assert_equal "lifo", topic.author_name
end
- def test_deprecated_delegating_private_method
- assert_deprecated do
- scope = Topic.all.by_private_lifo
- assert_not scope.instance_variable_get(:@delegate_to_klass)
- end
- end
-
def test_reserved_scope_names
klass = Class.new(ActiveRecord::Base) do
self.table_name = "topics"
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 45c93ca949..1009dd0f99 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -884,17 +884,6 @@ class TransactionTest < ActiveRecord::TestCase
assert_predicate transaction.state, :committed?
end
- def test_set_state_method_is_deprecated
- connection = Topic.connection
- transaction = ActiveRecord::ConnectionAdapters::TransactionManager.new(connection).begin_transaction
-
- transaction.commit
-
- assert_deprecated do
- transaction.state.set_state(:rolledback)
- end
- end
-
def test_mark_transaction_state_as_committed
connection = Topic.connection
transaction = ActiveRecord::ConnectionAdapters::TransactionManager.new(connection).begin_transaction