]> git.openstreetmap.org Git - rails.git/blob - test/controllers/profiles/links_controller_test.rb
Add empty profile links page
[rails.git] / test / controllers / profiles / links_controller_test.rb
1 require "test_helper"
2
3 module Profiles
4   class LinksControllerTest < ActionDispatch::IntegrationTest
5     ##
6     # test all routes which lead to this controller
7     def test_routes
8       assert_routing(
9         { :path => "/profile/links", :method => :get },
10         { :controller => "profiles/links", :action => "show" }
11       )
12       assert_routing(
13         { :path => "/profile/links", :method => :put },
14         { :controller => "profiles/links", :action => "update" }
15       )
16     end
17
18     def test_show
19       user = create(:user)
20       session_for(user)
21
22       get profile_links_path
23
24       assert_response :success
25       assert_template :show
26     end
27
28     def test_show_unauthorized
29       get profile_links_path
30
31       assert_redirected_to login_path(:referer => profile_links_path)
32     end
33   end
34 end