diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-24 13:59:40 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-24 13:59:40 -0700 |
commit | 74020eb2557cecf4cb4ed828bce2c87826a86697 (patch) | |
tree | f2c518f800658b204a5f12038c594ef5057ed2dc /actionpack | |
parent | b0e7db9ad9bf4183dda9521af46bf5395cf0ac72 (diff) | |
download | rails-74020eb2557cecf4cb4ed828bce2c87826a86697.tar.gz rails-74020eb2557cecf4cb4ed828bce2c87826a86697.tar.bz2 rails-74020eb2557cecf4cb4ed828bce2c87826a86697.zip |
use `make_set` helper method to generate route sets
We should keep the route set generation logic in one place
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 32 |
1 files changed, 1 insertions, 31 deletions
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" |