]> git.openstreetmap.org Git - rails.git/blobdiff - test/system/user_logout_test.rb
Simplify date display by using friendly_date helpers
[rails.git] / test / system / user_logout_test.rb
index a2e145fcc6aae2b6380acc3825e44021c445081f..fc27b7c1884ed606823f660d9c2ec73f5059bfa5 100644 (file)
@@ -4,19 +4,45 @@ class UserLogoutTest < ApplicationSystemTestCase
   test "Sign out via link" do
     user = create(:user)
     sign_in_as(user)
+    assert_no_content "Log In"
 
-    click_on user.display_name
-    click_on "Log Out"
-    assert page.has_content? "Log In"
+    click_button user.display_name
+    click_link "Log Out"
+    assert_content "Log In"
+  end
+
+  test "Sign out via link with referer" do
+    user = create(:user)
+    sign_in_as(user)
+    visit traces_path
+    assert_no_content "Log In"
+
+    click_button user.display_name
+    click_link "Log Out"
+    assert_content "Log In"
+    assert_content "Public GPS Traces"
   end
 
   test "Sign out via fallback page" do
     sign_in_as(create(:user))
+    assert_no_content "Log In"
 
     visit logout_path
-    assert page.has_content? "Logout from OpenStreetMap"
+    assert_content "Logout from OpenStreetMap"
+
+    click_button "Logout"
+    assert_content "Log In"
+  end
+
+  test "Sign out via fallback page with referer" do
+    sign_in_as(create(:user))
+    assert_no_content "Log In"
+
+    visit logout_path(:referer => "/traces")
+    assert_content "Logout from OpenStreetMap"
 
     click_button "Logout"
-    assert page.has_content? "Log In"
+    assert_content "Log In"
+    assert_content "Public GPS Traces"
   end
 end