From 64d14634ff89d2f9ce47872ef22822e6eb5fa18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 27 Oct 2016 18:44:40 +0200 Subject: [PATCH] Correctly clear theme double --- spec/lib/open_project/themes/theme_finder_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/lib/open_project/themes/theme_finder_spec.rb b/spec/lib/open_project/themes/theme_finder_spec.rb index b5aa4ebd32..d49fe69705 100644 --- a/spec/lib/open_project/themes/theme_finder_spec.rb +++ b/spec/lib/open_project/themes/theme_finder_spec.rb @@ -31,9 +31,9 @@ require 'spec_helper' module OpenProject module Themes describe ThemeFinder do - before do ThemeFinder.clear_themes end - # clear theme state after we are finished so that we do not disturb following tests - after(:all) do ThemeFinder.clear_themes end + after(:each) do + ThemeFinder.clear_themes + end describe '.themes' do it 'returns all instances of descendants of themes' do @@ -78,6 +78,7 @@ module OpenProject theme = double # do not invoke inherited callback ThemeFinder.register_theme(theme) expect(ThemeFinder.themes).to include theme + ThemeFinder.forget_theme(theme) end it 'clears the cache successfully' do