Permalink
Browse files

Fixes for standalone tests

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 11dde5c commit f85089aabbbb5fe218e27479081b7c745b3f8f94 @jeremy jeremy committed Dec 15, 2007
Showing with 10 additions and 3 deletions.
  1. +1 −0 actionpack/test/controller/request_test.rb
  2. +9 −3 actionpack/test/controller/routing_test.rb
@@ -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__)}/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 @@ def test_generate_all
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

0 comments on commit f85089a

Please sign in to comment.