Skip to content
Browse files

Get Railties tests passing

  • Loading branch information...
1 parent 1fb2c6f commit 9a5be2e5a80ab9e74294f32cfef58fbbcd9b637c Carlhuda committed Feb 24, 2010
View
2 actionmailer/lib/action_mailer/railtie.rb
@@ -6,7 +6,7 @@ class Railtie < Rails::Railtie
railtie_name :action_mailer
initializer "action_mailer.url_for", :before => :load_environment_config do |app|
- ActionMailer::Base.send(:include, ActionController::UrlFor) if defined?(ActionController)
+ ActionMailer::Base.send(:include, app.routes.named_url_helpers)
end
require "action_mailer/railties/log_subscriber"
View
2 railties/lib/rails/application.rb
@@ -48,7 +48,7 @@ def require_environment!
end
def routes
- ::ActionDispatch::Routing::Routes
+ @routes ||= ActionDispatch::Routing::RouteSet.new
end
def railties
View
3 railties/test/rails_info_controller_test.rb
@@ -18,6 +18,9 @@ def setup
match ':controller/:action'
end
@controller.stubs(:consider_all_requests_local? => false, :local_request? => true)
+ @router = Rails.application.routes
+
+ Rails::InfoController.send(:include, @router.named_url_helpers)
end
test "info controller does not allow remote requests" do

1 comment on commit 9a5be2e

@josh
Ruby on Rails member

Sweet, no more global state.

Please sign in to comment.
Something went wrong with that request. Please try again.