]> git.openstreetmap.org Git - rails.git/blob - test/controllers/accounts/pd_declarations_controller_test.rb
4b961e3268e44b112c1c1cf2b6b8cbf45d675bda
[rails.git] / test / controllers / accounts / pd_declarations_controller_test.rb
1 require "test_helper"
2
3 module Accounts
4   class PdDeclarationsControllerTest < ActionDispatch::IntegrationTest
5     ##
6     # test all routes which lead to this controller
7     def test_routes
8       assert_routing(
9         { :path => "/account/pd_declaration", :method => :get },
10         { :controller => "accounts/pd_declarations", :action => "show" }
11       )
12     end
13
14     def test_show_not_logged_in
15       get account_pd_declaration_path
16
17       assert_redirected_to login_path(:referer => account_pd_declaration_path)
18     end
19
20     def test_show_agreed
21       user = create(:user)
22       session_for(user)
23
24       get account_pd_declaration_path
25
26       assert_response :success
27     end
28   end
29 end