From af0361da0ac7e5b7703e772ce69c21c3315a54d0 Mon Sep 17 00:00:00 2001 From: Daniel Ma Date: Mon, 30 Oct 2017 11:21:28 -0700 Subject: `assert_changes` should always assert some change While using `assert_changes`, I came across some unexpected behavior: if you provide a `to:` argument, and the expression matches but didn't actually change, the assertion will pass. The way `assert_changes` reads, I assumed that it would both assert that there was any change at all, _and_ that the expression changed to match my `to:` argument. In the case of just a `from:` argument, `assert_changes` does what I expect as well. It asserts that the before value `=== from` and that the after value changed. My key change is that `assert_changes` will now _always_ assert that expression changes, no matter what combination of `from:` and `to:` arguments --- activesupport/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/CHANGELOG.md') diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 889919855c..a4c90c8b44 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,8 @@ +* `assert_changes` will always assert that the expression changes, + regardless of `from:` and `to:` argument combinations. + + *Daniel Ma* + * Allow `Range#include?` on TWZ ranges In #11474 we prevented TWZ ranges being iterated over which matched -- cgit v1.2.3