Fixed the route builder

This commit is contained in:
Joe Ferris 2009-02-04 22:04:08 -05:00
parent 0a2f0126df
commit 882349634c
1 changed files with 3 additions and 2 deletions

View File

@ -58,14 +58,15 @@ class Test::Unit::TestCase
ActionController::Routing.const_set('Routes', new_routes)
end
new_routes.draw(&block)
new_routes.load!
end
def build_response(&block)
klass = define_controller('Examples')
block ||= lambda { render :nothing => true }
klass.class_eval { define_method(:example, &block) }
define_routes {|map| map.resources :examples }
define_routes do |map|
map.connect 'examples', :controller => 'examples', :action => 'example'
end
@controller = klass.new
@request = ActionController::TestRequest.new