]> git.openstreetmap.org Git - rails.git/blob - test/integration/redirect_test.rb
Don't show "Load More" if we found less than 20 changesets
[rails.git] / test / integration / redirect_test.rb
1 require File.dirname(__FILE__) + '/../test_helper'
2
3 class RedirectTest  < ActionDispatch::IntegrationTest
4   def test_search_redirects
5     get "/?query=test"
6     assert_response :redirect
7     assert_redirected_to "/search?query=test"
8   end
9
10   def test_history_redirects
11     get "/browse"
12     assert_response :redirect
13     assert_redirected_to "/history"
14
15     get "/browse/changesets"
16     assert_response :redirect
17     assert_redirected_to "/history"
18
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"
22
23     get "/browse/friends"
24     assert_response :redirect
25     assert_redirected_to "/history/friends"
26
27     get "/browse/nearby"
28     assert_response :redirect
29     assert_redirected_to "/history/nearby"
30
31     get "/user/name/edits"
32     assert_response :redirect
33     assert_redirected_to "/user/name/history"
34
35     get "/user/name%20with%20spaces/edits"
36     assert_response :redirect
37     assert_redirected_to "/user/name%20with%20spaces/history"
38   end
39
40   def test_history_feed_redirects
41     get "/browse/changesets/feed"
42     assert_response :redirect
43     assert_redirected_to "/history/feed"
44
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"
48
49     get "/user/name/edits/feed"
50     assert_response :redirect
51     assert_redirected_to "/user/name/history/feed"
52
53     get "/user/name%20with%20spaces/edits/feed"
54     assert_response :redirect
55     assert_redirected_to "/user/name%20with%20spaces/history/feed"
56   end
57
58   def test_browse_redirects
59     get "/browse/node/1"
60     assert_response :redirect
61     assert_redirected_to "/node/1"
62
63     get "/browse/way/1"
64     assert_response :redirect
65     assert_redirected_to "/way/1"
66
67     get "/browse/relation/1"
68     assert_response :redirect
69     assert_redirected_to "/relation/1"
70
71     get "/browse/changeset/1"
72     assert_response :redirect
73     assert_redirected_to "/changeset/1"
74
75     get "/browse/note/1"
76     assert_response :redirect
77     assert_redirected_to "/note/1"
78   end
79
80   def test_browse_history_redirects
81     get "/browse/node/1/history"
82     assert_response :redirect
83     assert_redirected_to "/node/1/history"
84
85     get "/browse/way/1/history"
86     assert_response :redirect
87     assert_redirected_to "/way/1/history"
88
89     get "/browse/relation/1/history"
90     assert_response :redirect
91     assert_redirected_to "/relation/1/history"
92   end
93 end