1 require "application_system_test_case"
3 class UserLogoutTest < ApplicationSystemTestCase
4 test "Sign out via link" do
7 assert_not page.has_content? "Log In"
9 click_on user.display_name
11 assert page.has_content? "Log In"
14 test "Sign out via link with referer" do
18 assert_not page.has_content? "Log In"
20 click_on user.display_name
22 assert page.has_content? "Log In"
23 assert page.has_content? "Public GPS Traces"
26 test "Sign out via fallback page" do
27 sign_in_as(create(:user))
28 assert_not page.has_content? "Log In"
31 assert page.has_content? "Logout from OpenStreetMap"
34 assert page.has_content? "Log In"
37 test "Sign out via fallback page with referer" do
38 sign_in_as(create(:user))
39 assert_not page.has_content? "Log In"
41 visit logout_path(:referer => "/traces")
42 assert page.has_content? "Logout from OpenStreetMap"
45 assert page.has_content? "Log In"
46 assert page.has_content? "Public GPS Traces"