提交 eba3de99 编写于 作者: J Justin Collins

Add test for rescanning removed route

上级 2753115e
......@@ -20,4 +20,8 @@ class RemovalController < ApplicationController
render 'removal/controller_removed'
end
def implicit_render
@bad_stuff = raw params[:bad_stuff]
end
end
......@@ -2,6 +2,7 @@ Rails32::Application.routes.draw do
resources :users
match 'remove' => 'removal#remove_this_too'
match 'implicit' => 'removal#implicit_render'
# The priority is based upon order of creation:
# first created -> highest priority.
......
......@@ -99,7 +99,7 @@ class RescannerTests < Test::Unit::TestCase
assert_reindex :none
assert_changes
assert_new 0
assert_fixed 3
assert_fixed 4
end
def test_template_add_line
......@@ -158,4 +158,17 @@ class RescannerTests < Test::Unit::TestCase
assert_new 2
assert_fixed 0
end
def test_remove_route
routes = "config/routes.rb"
before_rescan_of routes do
replace routes, "match 'implicit' => 'removal#implicit_render'", ""
end
assert_reindex :controllers, :templates
assert_changes
assert_new 0
assert_fixed 1
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册