Skip to content

do not load test-case in development #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 8, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Rails.env.test?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire code should be inside the Railtie

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