]> git.openstreetmap.org Git - rails.git/blob - test/system/user_logout_test.rb
Use assert_not_predicate in tests that have assert_predicate
[rails.git] / test / system / user_logout_test.rb
1 require "application_system_test_case"
2
3 class UserLogoutTest < ApplicationSystemTestCase
4   test "Sign out via link" do
5     user = create(:user)
6     sign_in_as(user)
7     assert_no_content "Log In"
8
9     click_button user.display_name
10     click_link "Log Out"
11     assert_content "Log In"
12   end
13
14   test "Sign out via link with referer" do
15     user = create(:user)
16     sign_in_as(user)
17     visit traces_path
18     assert_no_content "Log In"
19
20     click_button user.display_name
21     click_link "Log Out"
22     assert_content "Log In"
23     assert_content "Public GPS Traces"
24   end
25
26   test "Sign out via fallback page" do
27     sign_in_as(create(:user))
28     assert_no_content "Log In"
29
30     visit logout_path
31     assert_content "Logout from OpenStreetMap"
32
33     click_button "Logout"
34     assert_content "Log In"
35   end
36
37   test "Sign out via fallback page with referer" do
38     sign_in_as(create(:user))
39     assert_no_content "Log In"
40
41     visit logout_path(:referer => "/traces")
42     assert_content "Logout from OpenStreetMap"
43
44     click_button "Logout"
45     assert_content "Log In"
46     assert_content "Public GPS Traces"
47   end
48 end