]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/users_controller_test.rb
Update tests to ensure referer is working
[rails.git] / test / controllers / users_controller_test.rb
index 4417d353facae1e55092a6dbb86e4b8f03b2886f..c40c30b28a986f1ce794edb57700256035c31e4b 100644 (file)
@@ -355,6 +355,20 @@ class UsersControllerTest < ActionController::TestCase
     assert_redirected_to "/test"
   end
 
+  def test_logout_fallback_without_referer
+    get :logout
+    assert_response :success
+    assert_template :logout
+    assert_select "input[name=referer][value=?]", ""
+  end
+
+  def test_logout_fallback_with_referer
+    get :logout, :params => { :referer => "/test" }
+    assert_response :success
+    assert_template :logout
+    assert_select "input[name=referer][value=?]", "/test"
+  end
+
   def test_logout_with_token
     token = create(:user).tokens.create