1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/application/url_generation_test.rb

47 lines
1 KiB
Ruby
Raw Normal View History

require 'isolation/abstract_unit'
module ApplicationTests
2012-01-05 20:30:17 -05:00
class UrlGenerationTest < ActiveSupport::TestCase
include ActiveSupport::Testing::Isolation
def app
Rails.application
end
test "it works" do
boot_rails
require "rails"
require "action_controller/railtie"
2013-07-30 05:28:31 -04:00
require "action_view/railtie"
class MyApp < Rails::Application
config.secret_key_base = "3b7cd727ee24e8444053437c36cc66c4"
2012-10-14 06:03:39 -04:00
config.session_store :cookie_store, key: "_myapp_session"
config.active_support.deprecation = :log
2012-10-18 13:33:40 -04:00
config.eager_load = false
end
Rails.application.initialize!
class ::ApplicationController < ActionController::Base
end
class ::OmgController < ::ApplicationController
def index
2012-10-14 06:03:39 -04:00
render text: omg_path
end
end
MyApp.routes.draw do
2012-10-14 06:03:39 -04:00
get "/" => "omg#index", as: :omg
end
require 'rack/test'
extend Rack::Test::Methods
get "/"
assert_equal "/", last_response.body
end
end
end