aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-07-07 12:50:38 +0200
committerJosé Valim <jose.valim@gmail.com>2010-07-07 12:50:38 +0200
commit8735d15e61797d0e6879efbde4f1ca18b4403eff (patch)
tree150bc9055ea55e26a02065ed32f6d6a703d50f5f /railties/test
parentb802a0d4c72fbd605b92e9f403c9b8765a6e480c (diff)
downloadrails-8735d15e61797d0e6879efbde4f1ca18b4403eff.tar.gz
rails-8735d15e61797d0e6879efbde4f1ca18b4403eff.tar.bz2
rails-8735d15e61797d0e6879efbde4f1ca18b4403eff.zip
Add a test to ensure url helpers are not action methods in ActionMailer.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/initializers/frameworks_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb
index b1deb7a645..4ff10091b1 100644
--- a/railties/test/application/initializers/frameworks_test.rb
+++ b/railties/test/application/initializers/frameworks_test.rb
@@ -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 []