Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-05-10 15:30:14 +0300
committerRémy Coutable <remy@rymai.me>2019-05-10 15:40:04 +0300
commitf59438c0a9da7bb4d98291d2adedfc5a13a50798 (patch)
treecc08eb4e3d5298c76b20696dfdf7ddfc0ca2ac10 /spec/spec_helper.rb
parentb575b303434577ab7d409a8c7321c0bce96d0994 (diff)
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: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 9266bee34d6..69589c9aa33 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -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