Skip to content

Commit

Permalink
Merge pull request #28 from grosser/grosser/test-load
Browse files Browse the repository at this point in the history
do not load test-case in development
  • Loading branch information
rafaelfranca committed Jan 8, 2014
2 parents 2841450 + c04e4d0 commit 3f512ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions lib/prototype-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ 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: 0 additions & 5 deletions lib/prototype-rails/on_load_action_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,4 @@
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: 6 additions & 0 deletions test/lib/abstract_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
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 3f512ec

Please sign in to comment.