aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-08-26 16:32:08 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-08-26 16:32:08 -0500
commit47cce917f266baa0c51bb259b8ad678c0422830d (patch)
treeeea620a54de98e9a78ea1e73b726d7003dea954c
parentea84b0c6183949750f0801db50d22e58d62ec024 (diff)
downloadrails-47cce917f266baa0c51bb259b8ad678c0422830d.tar.gz
rails-47cce917f266baa0c51bb259b8ad678c0422830d.tar.bz2
rails-47cce917f266baa0c51bb259b8ad678c0422830d.zip
fix order dependent test in AggregationsTest
Ensure class variable is set to nil. It prevents the following test to fail: def test_do_not_run_the_converter_when_nil_was_set customers(:david).non_blank_gps_location = nil assert_nil Customer.gps_conversion_was_run end Check https://github.com/rails/rails/blob/master/activerecord/test/models/customer.rb#L7 for more information.
-rw-r--r--activerecord/test/cases/aggregations_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/aggregations_test.rb b/activerecord/test/cases/aggregations_test.rb
index 5bd8f76ba2..48b06a767f 100644
--- a/activerecord/test/cases/aggregations_test.rb
+++ b/activerecord/test/cases/aggregations_test.rb
@@ -114,6 +114,8 @@ class AggregationsTest < ActiveRecord::TestCase
customers(:david).save
customers(:david).reload
assert_nil customers(:david).non_blank_gps_location
+ ensure
+ Customer.gps_conversion_was_run = nil
end
def test_nil_return_from_converter_results_in_failure_when_allow_nil_is_false