Commit f59438c0 authored by Rémy Coutable's avatar Rémy Coutable

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
https://github.com/rails/rails-controller-testing/blob/21014e48be124dd8d0af250b79f682519d445015/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: https://github.com/rails/rails-controller-testing/blob/21014e48be124dd8d0af250b79f682519d445015/lib/rails/controller/testing/template_assertions.rb#L54

Using an around hook allows the @_subscribers instance variable to be
set.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b575b303
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment