]> git.openstreetmap.org Git - rails.git/blob - test/controllers/relation_members_controller_test.rb
Lazy loading relation members
[rails.git] / test / controllers / relation_members_controller_test.rb
1 require "test_helper"
2
3 class RelationMembersControllerTest < ActionDispatch::IntegrationTest
4   ##
5   # test all routes which lead to this controller
6   def test_routes
7     assert_routing(
8       { :path => "/relation/1/members", :method => :get },
9       { :controller => "relation_members", :action => "show", :id => "1" }
10     )
11   end
12
13   def test_show_with_members
14     relation = create(:relation)
15     get relation_members_path(relation)
16     assert_response :success
17   end
18
19   def test_show_not_found
20     get relation_members_path(0)
21
22     assert_response :not_found
23   end
24
25   def test_show_timeout
26     relation = create(:relation)
27
28     with_settings(:web_timeout => -1) do
29       get relation_members_path(relation, 1)
30     end
31
32     assert_response :error
33   end
34 end