diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-02-25 16:48:36 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-02-25 17:53:29 -0800 |
commit | fc4582fb6684ce72f5628629ea7d061659b790f8 (patch) | |
tree | 7d49d64d8ad3e7c91009e2b9804db9f7ed652177 /railties/test/application | |
parent | 36fd9efb5e4bfc9ac3acd4189d4dc457dea8102a (diff) | |
download | rails-fc4582fb6684ce72f5628629ea7d061659b790f8.tar.gz rails-fc4582fb6684ce72f5628629ea7d061659b790f8.tar.bz2 rails-fc4582fb6684ce72f5628629ea7d061659b790f8.zip |
Final pass at removing the router from a global constant
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/url_generation_test.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/railties/test/application/url_generation_test.rb b/railties/test/application/url_generation_test.rb new file mode 100644 index 0000000000..a0d9ff7a3a --- /dev/null +++ b/railties/test/application/url_generation_test.rb @@ -0,0 +1,42 @@ +require 'isolation/abstract_unit' + +module ApplicationTests + class UrlGenerationTest < Test::Unit::TestCase + include ActiveSupport::Testing::Isolation + + def app + Rails.application + end + + test "it works" do + boot_rails + require "rails" + require "action_controller/railtie" + + class MyApp < Rails::Application + config.action_controller.session = { :key => "_myapp_session", :secret => "3b7cd727ee24e8444053437c36cc66c4" } + end + + MyApp.initialize! + + class ::ApplicationController < ActionController::Base + end + + class ::OmgController < ::ApplicationController + def index + render :text => omg_path + end + end + + MyApp.routes.draw do + match "/" => "omg#index", :as => :omg + end + + require 'rack/test' + extend Rack::Test::Methods + + get "/" + assert_equal "/", last_response.body + end + end +end |