mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Add a test to ensure url helpers are not action methods in ActionMailer.
This commit is contained in:
@@ -45,6 +45,25 @@ module ApplicationTests
|
||||
assert_equal "test.rails", ActionMailer::Base.default_url_options[:host]
|
||||
end
|
||||
|
||||
test "does not include url helpers as action methods" do
|
||||
app_file "config/routes.rb", <<-RUBY
|
||||
AppTemplate::Application.routes.draw do
|
||||
get "/foo", :to => lambda { |env| [200, {}, []] }, :as => :foo
|
||||
end
|
||||
RUBY
|
||||
|
||||
app_file "app/mailers/foo.rb", <<-RUBY
|
||||
class Foo < ActionMailer::Base
|
||||
def notify
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
|
||||
require "#{app_path}/config/environment"
|
||||
assert Foo.method_defined?(:foo_path)
|
||||
assert_equal ["notify"], Foo.action_methods
|
||||
end
|
||||
|
||||
# AS
|
||||
test "if there's no config.active_support.bare, all of ActiveSupport is required" do
|
||||
use_frameworks []
|
||||
|
||||
Reference in New Issue
Block a user