aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_one_through_associations_test.rb1
-rw-r--r--activerecord/test/cases/integration_test.rb2
-rw-r--r--activerecord/test/cases/multiparameter_attributes_test.rb4
-rw-r--r--activerecord/test/cases/transactions_test.rb5
4 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_one_through_associations_test.rb b/activerecord/test/cases/associations/has_one_through_associations_test.rb
index 90c557e886..01a4137a5d 100644
--- a/activerecord/test/cases/associations/has_one_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_one_through_associations_test.rb
@@ -191,6 +191,7 @@ class HasOneThroughAssociationsTest < ActiveRecord::TestCase
end
def test_preloading_has_one_through_on_belongs_to
+ MemberDetail.delete_all
assert_not_nil @member.member_type
@organization = organizations(:nsa)
@member_detail = MemberDetail.new
diff --git a/activerecord/test/cases/integration_test.rb b/activerecord/test/cases/integration_test.rb
index b0a7cda2f3..f5daca2fa8 100644
--- a/activerecord/test/cases/integration_test.rb
+++ b/activerecord/test/cases/integration_test.rb
@@ -32,6 +32,8 @@ class IntegrationTest < ActiveRecord::TestCase
est_key = Developer.first.cache_key
assert_equal utc_key, est_key
+ ensure
+ Time.zone = 'UTC'
end
def test_cache_key_format_for_existing_record_with_updated_at
diff --git a/activerecord/test/cases/multiparameter_attributes_test.rb b/activerecord/test/cases/multiparameter_attributes_test.rb
index 1209f5460f..ce21760645 100644
--- a/activerecord/test/cases/multiparameter_attributes_test.rb
+++ b/activerecord/test/cases/multiparameter_attributes_test.rb
@@ -11,6 +11,10 @@ class MultiParameterAttributeTest < ActiveRecord::TestCase
Time.zone = nil
end
+ def teardown
+ ActiveRecord::Base.default_timezone = :utc
+ end
+
def test_multiparameter_attributes_on_date
attributes = { "last_read(1i)" => "2004", "last_read(2i)" => "6", "last_read(3i)" => "24" }
topic = Topic.find(1)
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 9c5f2e4724..f84088def3 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -453,6 +453,11 @@ class TransactionTest < ActiveRecord::TestCase
raise ActiveRecord::Rollback
end
end
+
+ ensure
+ Topic.reset_column_information # reset the column information to get correct reading
+ Topic.connection.remove_column('topics', 'stuff') if Topic.column_names.include?('stuff')
+ Topic.reset_column_information # reset the column information again for other tests
end
def test_transactions_state_from_rollback