Use a post link to logout

This avoids needing to access the session id, which is currently
only working with the memcache store.

The fallback page is preserved for anyone who wants to logout without
using javascript.

Refs #2488
This commit is contained in:
Andy Allan 2020-01-08 14:01:17 +01:00
parent 17ecde019d
commit 8a774e7519
5 changed files with 27 additions and 29 deletions

View file

@ -0,0 +1,22 @@
require "application_system_test_case"
class UserLogoutTest < ApplicationSystemTestCase
test "Sign out via link" do
user = create(:user)
sign_in_as(user)
click_on user.display_name
click_on "Log Out"
assert page.has_content? "Log In"
end
test "Sign out via fallback page" do
sign_in_as(create(:user))
visit logout_path
assert page.has_content? "Logout from OpenStreetMap"
click_button "Logout"
assert page.has_content? "Log In"
end
end