Skip to content

Commit

Permalink
Merge pull request #33 from grosser/grosser/fix
Browse files Browse the repository at this point in the history
fix test-case vs devise vs rails 4.2
  • Loading branch information
rafaelfranca committed Jan 22, 2015
2 parents c548aa4 + f047d9f commit 13f2ca7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/prototype-rails/on_load_action_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
include ActionView::Helpers::ScriptaculousHelper
end

ActionView::TestCase.class_eval do
include ActionView::Helpers::PrototypeHelper
include ActionView::Helpers::ScriptaculousHelper
if defined?(Rails.env) && 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
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 13f2ca7

Please sign in to comment.