Fix unrelated errors when teardowning quanrantined specs

Since we're skipping the example in a before hook, the @_subscribers
instance variable that is normally set in the setup phase of the test by
21014e48be/lib/rails/controller/testing/template_assertions.rb (L21)
isn't set but the teardown phase of the example still happens and tries
to iterate over the array of subcribers: 21014e48be/lib/rails/controller/testing/template_assertions.rb (L54)

Using an around hook allows the @_subscribers instance variable to be
set.

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2019-05-10 14:30:14 +02:00
parent b575b30343
commit f59438c0a9
No known key found for this signature in database
GPG key ID: 98DFFD1C0C62B70B

View file

@ -138,7 +138,7 @@ RSpec.configure do |config|
.and_return(false)
end
config.before(:example, :quarantine) do
config.around(:example, :quarantine) do
# Skip tests in quarantine unless we explicitly focus on them.
skip('In quarantine') unless config.inclusion_filter[:quarantine]
end