From 74020eb2557cecf4cb4ed828bce2c87826a86697 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 24 Aug 2015 13:59:40 -0700 Subject: use `make_set` helper method to generate route sets We should keep the route set generation logic in one place --- actionpack/test/controller/routing_test.rb | 32 +----------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'actionpack') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index feb3e7eab7..c9554a0f58 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1742,40 +1742,10 @@ class RouteSetTest < ActiveSupport::TestCase include ActionDispatch::RoutingVerbs - class TestSet < ActionDispatch::Routing::RouteSet - def initialize(block) - @block = block - super() - end - - class Dispatcher < ActionDispatch::Routing::RouteSet::Dispatcher - def initialize(defaults, set, block) - super(defaults) - @block = block - @set = set - end - - def controller_reference(controller_param) - block = @block - set = @set - Class.new(ActionController::Base) { - include set.url_helpers - define_method(:process) { |name| block.call(self) } - def to_a; [200, {}, []]; end - } - end - end - - def dispatcher defaults - TestSet::Dispatcher.new defaults, self, @block - end - end - alias :routes :set def test_generate_with_optional_params_recalls_last_request - controller = nil - @set = TestSet.new ->(c) { controller = c } + @set = make_set false set.draw do get "blog/", :controller => "blog", :action => "index" -- cgit v1.2.3