mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Move view context clear to before_setup (minitest) (#839)
We are using Draper with Minitest and experiencing the "leakage" of mailer view contexts into decorator tests. See #814 and related. Draper does attempt to prevent the leakage by clearing the view context in a `teardown` hook, but this isn't effective. We are still seeing the problem. This PR moves the clearing from `teardown` to `before_setup`, which properly resolves the leakage.
This commit is contained in:
parent
4ddd3a0187
commit
7e3ace0242
1 changed files with 2 additions and 2 deletions
|
@ -3,9 +3,9 @@ module Draper
|
|||
|
||||
class TestCase < ::ActiveSupport::TestCase
|
||||
module ViewContextTeardown
|
||||
def teardown
|
||||
super
|
||||
def before_setup
|
||||
Draper::ViewContext.clear!
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue