From e45f388eb439448f4f87eabcef1bc01a14faa4a5 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sat, 28 May 2016 22:26:45 +0200 Subject: [PATCH] Fix assertion count after 69e1bb52. When changing the generated integration tests to assert redirects with an absolute path this redirection check in `assert_redirected_to` against the absolute response location would now pass: https://github.com/rails/rails/blob/af245aaf3a1c447752a1b5895adddc66e5f73c00/actionpack/lib/action_dispatch/testing/assertions/response.rb#L55 Thus we'd break early instead of hitting `assert_operator` and have 2 fewer assertions per `assert_redirected_to` as `assert_operator` is composed of 2 assertions internally: https://github.com/seattlerb/minitest/blob/4e146b1515b19a5c474e39c174b037510f6dbc6e/lib/minitest/assertions.rb#L254-L258 Deduct 2 assertions for 2 redirects taking the expected count down by 4 in total for the two failing tests. --- railties/test/application/rake_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index acdb4e7d79..badb9ecdd6 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -287,7 +287,7 @@ module ApplicationTests RAILS_ENV=test bin/rails db:migrate test` end - assert_match(/7 runs, 12 assertions, 0 failures, 0 errors/, output) + assert_match(/7 runs, 9 assertions, 0 failures, 0 errors/, output) assert_no_match(/Errors running/, output) end @@ -318,7 +318,7 @@ module ApplicationTests RAILS_ENV=test bin/rails db:migrate test` end - assert_match(/7 runs, 12 assertions, 0 failures, 0 errors/, output) + assert_match(/7 runs, 9 assertions, 0 failures, 0 errors/, output) assert_no_match(/Errors running/, output) end