mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixes for standalone tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
11dde5ca2f
commit
f85089aabb
2 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
require File.dirname(__FILE__) + '/../abstract_unit'
|
||||
require 'action_controller/integration'
|
||||
|
||||
class RequestTest < Test::Unit::TestCase
|
||||
def setup
|
||||
|
|
|
@ -2,6 +2,12 @@ require "#{File.dirname(__FILE__)}/../abstract_unit"
|
|||
require "#{File.dirname(__FILE__)}/fake_controllers"
|
||||
require 'action_controller/routing'
|
||||
|
||||
class MilestonesController < ActionController::Base
|
||||
def index() head :ok end
|
||||
alias_method :show, :index
|
||||
def rescue_action(e) raise e end
|
||||
end
|
||||
|
||||
RunTimeTests = ARGV.include? 'time'
|
||||
ROUTING = ActionController::Routing
|
||||
|
||||
|
@ -2023,14 +2029,14 @@ class RouteSetTest < Test::Unit::TestCase
|
|||
def test_named_route_in_nested_resource
|
||||
set.draw do |map|
|
||||
map.resources :projects do |project|
|
||||
project.comments 'comments', :controller => 'comments', :action => 'index'
|
||||
project.milestones 'milestones', :controller => 'milestones', :action => 'index'
|
||||
end
|
||||
end
|
||||
|
||||
request.path = "/projects/1/comments"
|
||||
request.path = "/projects/1/milestones"
|
||||
request.method = :get
|
||||
assert_nothing_raised { set.recognize(request) }
|
||||
assert_equal("comments", request.path_parameters[:controller])
|
||||
assert_equal("milestones", request.path_parameters[:controller])
|
||||
assert_equal("index", request.path_parameters[:action])
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue