]> git.openstreetmap.org Git - rails.git/blob - test/system/user_logout_test.rb
Use a post link to logout
[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
8     click_on user.display_name
9     click_on "Log Out"
10     assert page.has_content? "Log In"
11   end
12
13   test "Sign out via fallback page" do
14     sign_in_as(create(:user))
15
16     visit logout_path
17     assert page.has_content? "Logout from OpenStreetMap"
18
19     click_button "Logout"
20     assert page.has_content? "Log In"
21   end
22 end