Replace some legacy routes with redirects
This commit is contained in:
parent
ba4a3e3ce9
commit
e418075e26
4 changed files with 17 additions and 15 deletions
|
@ -14,10 +14,6 @@ class SiteControllerTest < ActionController::TestCase
|
|||
{ :path => "/", :method => :post },
|
||||
{ :controller => "site", :action => "index" }
|
||||
)
|
||||
assert_recognizes(
|
||||
{ :controller => "site", :action => "index" },
|
||||
{ :path => "/index.html", :method => :get }
|
||||
)
|
||||
assert_routing(
|
||||
{ :path => "/edit", :method => :get },
|
||||
{ :controller => "site", :action => "edit" }
|
||||
|
|
|
@ -49,10 +49,6 @@ class UserControllerTest < ActionController::TestCase
|
|||
{ :path => "/user/new", :method => :get },
|
||||
{ :controller => "user", :action => "new" }
|
||||
)
|
||||
assert_recognizes(
|
||||
{ :controller => "user", :action => "new" },
|
||||
{ :path => "/create-account.html", :method => :get }
|
||||
)
|
||||
|
||||
assert_routing(
|
||||
{ :path => "/user/new", :method => :post },
|
||||
|
@ -112,10 +108,6 @@ class UserControllerTest < ActionController::TestCase
|
|||
{ :path => "/user/forgot-password", :method => :post },
|
||||
{ :controller => "user", :action => "lost_password" }
|
||||
)
|
||||
assert_recognizes(
|
||||
{ :controller => "user", :action => "lost_password" },
|
||||
{ :path => "/forgot-password.html", :method => :get }
|
||||
)
|
||||
assert_routing(
|
||||
{ :path => "/user/reset-password", :method => :get },
|
||||
{ :controller => "user", :action => "reset_password" }
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class RedirectTest < ActionDispatch::IntegrationTest
|
||||
def test_legacy_redirects
|
||||
get "/index.html"
|
||||
assert_response :redirect
|
||||
assert_redirected_to "/"
|
||||
|
||||
get "/create-account.html"
|
||||
assert_response :redirect
|
||||
assert_redirected_to "/user/new"
|
||||
|
||||
get "/forgot-password.html"
|
||||
assert_response :redirect
|
||||
assert_redirected_to "/user/forgot-password"
|
||||
end
|
||||
|
||||
def test_search_redirects
|
||||
get "/?query=test"
|
||||
assert_response :redirect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue