From 26ad3be4a734728eb07480393b4d57dd9b6e58ed Mon Sep 17 00:00:00 2001 From: Gaizka Date: Tue, 28 May 2013 19:56:20 +0200 Subject: [PATCH] Clear ViewContext before specs instead of after By doing it before, we get sure that another type of spec (model, acceptance) does not leave ViewContext in a wrong context... https://github.com/drapergem/draper/issues/523 --- lib/draper/test/rspec_integration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/draper/test/rspec_integration.rb b/lib/draper/test/rspec_integration.rb index 0a787fe..e631714 100755 --- a/lib/draper/test/rspec_integration.rb +++ b/lib/draper/test/rspec_integration.rb @@ -10,7 +10,7 @@ module Draper config.include DecoratorExampleGroup, example_group: {file_path: %r{spec/decorators}}, type: :decorator [:decorator, :controller, :mailer].each do |type| - config.after(:each, type: type) { Draper::ViewContext.clear! } + config.before(:each, type: type) { Draper::ViewContext.clear! } end end end