Browse files

Don't patch ActionView::TestCase outside of test env.

Fixes "cannot load such file -- test/unit/testcase (LoadError)"
when deploying to Heroku.
1 parent 967bc9b commit 16f68a7529dea20372561188e2c6a721e0d305ae @jasoncodes jasoncodes committed Dec 12, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/prototype-rails/on_load_action_view.rb
View
8 lib/prototype-rails/on_load_action_view.rb
@@ -14,9 +14,11 @@
include ActionView::Helpers::ScriptaculousHelper
end
-ActionView::TestCase.class_eval do
- include ActionView::Helpers::PrototypeHelper
- include ActionView::Helpers::ScriptaculousHelper
+if Rails.env.test?
+ ActionView::TestCase.class_eval do
+ include ActionView::Helpers::PrototypeHelper
+ include ActionView::Helpers::ScriptaculousHelper
+ end
end
ActionView::Template.register_template_handler :rjs, ActionView::Template::Handlers::RJS.new

0 comments on commit 16f68a7

Please sign in to comment.