aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index a3b06cea8..c7fb0af75 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -96,6 +96,16 @@ Spork.prefork do
I18n.locale = @save_i18n_locale
end
+ # Turn routing-filter off in functional and unit tests as per
+ # https://github.com/svenfuchs/routing-filter/blob/master/README.markdown#testing
+ config.before(:each) do
+ RoutingFilter.active = false if [:controller, :helper, :model].include? example.metadata[:type]
+ end
+
+ config.after(:each) do
+ RoutingFilter.active = true if [:controller, :helper, :model].include? example.metadata[:type]
+ end
+
# This section makes the garbage collector run less often to speed up tests
last_gc_run = Time.now