Skip to content

Commit

Permalink
Revert "Merge pull request rails#28 from grosser/grosser/test-load"
Browse files Browse the repository at this point in the history
This reverts commit 3f512ec, reversing
changes made to 2841450.

Reason: I'll use the solution in
rails#23 that doesn't check the
Rails environment
  • Loading branch information
Rafael Mendonça França committed Feb 6, 2014
1 parent 6849a2b commit bc80415
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
6 changes: 0 additions & 6 deletions lib/prototype-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ class Engine < Rails::Engine

ActiveSupport.on_load(:action_view) do
require 'prototype-rails/on_load_action_view'
if Rails.env.test?
ActionView::TestCase.class_eval do
include ActionView::Helpers::PrototypeHelper
include ActionView::Helpers::ScriptaculousHelper
end
end
end
end
end
Expand Down
5 changes: 5 additions & 0 deletions lib/prototype-rails/on_load_action_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@
include ActionView::Helpers::ScriptaculousHelper
end

ActionView::TestCase.class_eval do
include ActionView::Helpers::PrototypeHelper
include ActionView::Helpers::ScriptaculousHelper
end

ActionView::Template.register_template_handler :rjs, ActionView::Template::Handlers::RJS.new
6 changes: 0 additions & 6 deletions test/lib/abstract_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
require 'action_view'
require 'action_view/testing/resolvers'

module Rails
def self.env
ActiveSupport::StringInquirer.new("test")
end
end

require 'prototype-rails/on_load_action_controller'
require 'prototype-rails/on_load_action_view'

Expand Down

0 comments on commit bc80415

Please sign in to comment.