1 require File.dirname(__FILE__) + '/../test_helper'
3 class RedirectTest < ActionDispatch::IntegrationTest
4 def test_search_redirects
6 assert_response :redirect
7 assert_redirected_to "/search?query=test"
10 def test_history_redirects
12 assert_response :redirect
13 assert_redirected_to "/history"
15 get "/browse/changesets"
16 assert_response :redirect
17 assert_redirected_to "/history"
19 get "/browse/changesets?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
20 assert_response :redirect
21 assert_redirected_to "/history?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
24 assert_response :redirect
25 assert_redirected_to "/history/friends"
28 assert_response :redirect
29 assert_redirected_to "/history/nearby"
31 get "/user/name/edits"
32 assert_response :redirect
33 assert_redirected_to "/user/name/history"
35 get "/user/name%20with%20spaces/edits"
36 assert_response :redirect
37 assert_redirected_to "/user/name%20with%20spaces/history"
40 def test_history_feed_redirects
41 get "/browse/changesets/feed"
42 assert_response :redirect
43 assert_redirected_to "/history/feed"
45 get "/browse/changesets/feed?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
46 assert_response :redirect
47 assert_redirected_to "/history/feed?bbox=-80.54%2C40.358%2C-79.526%2C40.779"
49 get "/user/name/edits/feed"
50 assert_response :redirect
51 assert_redirected_to "/user/name/history/feed"
53 get "/user/name%20with%20spaces/edits/feed"
54 assert_response :redirect
55 assert_redirected_to "/user/name%20with%20spaces/history/feed"
58 def test_browse_redirects
60 assert_response :redirect
61 assert_redirected_to "/node/1"
64 assert_response :redirect
65 assert_redirected_to "/way/1"
67 get "/browse/relation/1"
68 assert_response :redirect
69 assert_redirected_to "/relation/1"
71 get "/browse/changeset/1"
72 assert_response :redirect
73 assert_redirected_to "/changeset/1"
76 assert_response :redirect
77 assert_redirected_to "/note/1"
80 def test_browse_history_redirects
81 get "/browse/node/1/history"
82 assert_response :redirect
83 assert_redirected_to "/node/1/history"
85 get "/browse/way/1/history"
86 assert_response :redirect
87 assert_redirected_to "/way/1/history"
89 get "/browse/relation/1/history"
90 assert_response :redirect
91 assert_redirected_to "/relation/1/history"