3 class RedirectTest < ActionDispatch::IntegrationTest
4 def test_legacy_redirects
6 assert_redirected_to "/"
8 get "/create-account.html"
9 assert_redirected_to "/user/new"
11 get "/forgot-password.html"
12 assert_redirected_to "/user/forgot-password"
15 def test_search_redirects
17 assert_redirected_to "/search?query=test"
20 def test_history_redirects
22 assert_redirected_to "/history"
24 get "/browse/changesets"
25 assert_redirected_to "/history"
27 get "/browse/changesets?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
28 assert_redirected_to "/history?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
31 assert_redirected_to "/history/friends"
34 assert_redirected_to "/history/nearby"
36 get "/user/name/edits"
37 assert_redirected_to "/user/name/history"
39 get "/user/name%20with%20spaces/edits"
40 assert_redirected_to "/user/name%20with%20spaces/history"
43 def test_history_feed_redirects
44 get "/browse/changesets/feed"
45 assert_redirected_to "/history/feed"
47 get "/browse/changesets/feed?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
48 assert_redirected_to "/history/feed?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
50 get "/user/name/edits/feed"
51 assert_redirected_to "/user/name/history/feed"
53 get "/user/name%20with%20spaces/edits/feed"
54 assert_redirected_to "/user/name%20with%20spaces/history/feed"
57 def test_browse_redirects
59 assert_redirected_to "/node/1"
62 assert_redirected_to "/way/1"
64 get "/browse/relation/1"
65 assert_redirected_to "/relation/1"
67 get "/browse/changeset/1"
68 assert_redirected_to "/changeset/1"
71 assert_redirected_to "/note/1"
74 def test_browse_history_redirects
75 get "/browse/node/1/history"
76 assert_redirected_to "/node/1/history"
78 get "/browse/way/1/history"
79 assert_redirected_to "/way/1/history"
81 get "/browse/relation/1/history"
82 assert_redirected_to "/relation/1/history"