]> git.openstreetmap.org Git - rails.git/blob - test/controllers/notifications_controller_test.rb
Merge remote-tracking branch 'upstream/pull/7289'
[rails.git] / test / controllers / notifications_controller_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 class NotificationsControllerTest < ActionDispatch::IntegrationTest
6   def test_routes
7     assert_routing(
8       { :path => "/notifications", :method => :get },
9       { :controller => "notifications", :action => "index" }
10     )
11   end
12
13   def test_index
14     session_for(create(:user))
15     get notifications_path
16
17     assert_response :success
18     assert_template "index"
19   end
20
21   def test_index_unauthorized
22     get notifications_path
23
24     assert_redirected_to login_path(:referer => notifications_path)
25   end
26 end