diff options
Diffstat (limited to 'railties/test/application/url_generation_test.rb')
-rw-r--r-- | railties/test/application/url_generation_test.rb | 43 |
1 files changed, 43 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..04f5454e09 --- /dev/null +++ b/railties/test/application/url_generation_test.rb @@ -0,0 +1,43 @@ +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.cookie_secret = "3b7cd727ee24e8444053437c36cc66c4" + config.session_store :cookie_store, :key => "_myapp_session" + 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 |