Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit 47cce917f266baa0c51bb259b8ad678c0422830d 1 parent ea84b0c
Francesco Rodriguez authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  activerecord/test/cases/aggregations_test.rb
View
2  activerecord/test/cases/aggregations_test.rb
@@ -114,6 +114,8 @@ def test_nil_return_from_converter_is_respected_when_allow_nil_is_true
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

0 comments on commit 47cce91

Please sign in to comment.
Something went wrong with that request. Please try again.