diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-08 10:09:39 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-08 10:09:39 -0400 |
commit | 4a1207d54077348b67fad95ffde5710cf0be31bd (patch) | |
tree | de721528fa81f1dfe50449c2d5c3985f513e83cd /railties/test/application | |
parent | f6fa6cf6117e691899c821b8999bd7dfb3f48b38 (diff) | |
parent | dc364fdc595405aa3d5735e60d46ad3f9544a65b (diff) | |
download | rails-4a1207d54077348b67fad95ffde5710cf0be31bd.tar.gz rails-4a1207d54077348b67fad95ffde5710cf0be31bd.tar.bz2 rails-4a1207d54077348b67fad95ffde5710cf0be31bd.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 21 | ||||
-rw-r--r-- | railties/test/application/initializers/i18n_test.rb | 2 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 4 | ||||
-rw-r--r-- | railties/test/application/runner_test.rb | 2 |
4 files changed, 24 insertions, 5 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 7269a7c5a8..4ff10091b1 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -36,7 +36,7 @@ module ApplicationTests test "allows me to configure default url options for ActionMailer" do app_file "config/environments/development.rb", <<-RUBY - Rails::Application.configure do + AppTemplate::Application.configure do config.action_mailer.default_url_options = { :host => "test.rails" } end RUBY @@ -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 [] diff --git a/railties/test/application/initializers/i18n_test.rb b/railties/test/application/initializers/i18n_test.rb index a1fcba3310..4baa8a8170 100644 --- a/railties/test/application/initializers/i18n_test.rb +++ b/railties/test/application/initializers/i18n_test.rb @@ -16,7 +16,7 @@ module ApplicationTests end def app - @app ||= Rails::Application + @app ||= Rails.application end def assert_fallbacks(fallbacks) diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 40fb446b16..d6e100ffe3 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -24,11 +24,11 @@ module ApplicationTests app_file "config/environment.rb", <<-RUBY SuperMiddleware = Struct.new(:app) - Rails::Application.configure do + AppTemplate::Application.configure do config.middleware.use SuperMiddleware end - Rails::Application.initialize! + AppTemplate::Application.initialize! RUBY assert_match "SuperMiddleware", Dir.chdir(app_path){ `rake middleware` } diff --git a/railties/test/application/runner_test.rb b/railties/test/application/runner_test.rb index d37b7649e2..07a3d94120 100644 --- a/railties/test/application/runner_test.rb +++ b/railties/test/application/runner_test.rb @@ -19,7 +19,7 @@ module ApplicationTests end def test_should_run_ruby_statement - assert_match "42", Dir.chdir(app_path) { `bundle exec rails runner "puts User.count"` } + assert_match "42", Dir.chdir(app_path) { `bundle exec rails runner "puts User.count"` } end def test_should_run_file |