summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-02 18:07:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-02 18:07:35 +0000
commite821020394a658ae979d55046c7f0138ea9cc659 (patch)
tree2263e376738a1a02577aa046a55e45a9bc8f4372 /test/test_helper.rb
parentf474d1ff81a0b7927b37dfd6deceb2fed5e6dfb3 (diff)
downloadredmine-e821020394a658ae979d55046c7f0138ea9cc659.tar.gz
redmine-e821020394a658ae979d55046c7f0138ea9cc659.zip
Make the tests pass when config.threadsafe! is enabled (#12097).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10910 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 91e0d8cc6..5c166687e 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -492,3 +492,14 @@ end
# Simple module to "namespace" all of the API tests
module ApiTest
end
+
+# URL helpers do not work with config.threadsafe!
+# https://github.com/rspec/rspec-rails/issues/476#issuecomment-4705454
+ActionView::TestCase::TestController.instance_eval do
+ helper Rails.application.routes.url_helpers
+end
+ActionView::TestCase::TestController.class_eval do
+ def _routes
+ Rails.application.routes
+ end
+end