blob: 2b6ec26cd0a81b25b0b6e431440e98ecd538221f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
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.secret_token = "3b7cd727ee24e8444053437c36cc66c4"
config.session_store :cookie_store, :key => "_myapp_session"
config.active_support.deprecation = :log
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
|