[openstreetmap/openstreetmap-website] Use a post link to logout (#2496)

Andy Allan notifications at github.com
Wed Jan 8 17:30:59 UTC 2020


gravitystorm commented on this pull request.



> @@ -344,27 +344,13 @@ def test_save_referer_params
   end
 
   def test_logout_without_referer
-    get :logout
-    assert_response :success
-    assert_template :logout
-    assert_select "input[name=referer][value=?]", ""
-
-    session_id = assert_select("input[name=session]").first["value"]
-
-    get :logout, :params => { :session => session_id }

Sure, I've added those bits of the tests back in. I've also added a system test that clicks the button and checks the redirect, as well as a system test that checks the referer works for normal behaviour.

(I added the last two as system tests, since I dislike writing controller tests where you check the form, and then try submitting a facsimile of what you hope the browser sends)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2496#discussion_r364352911
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200108/b90472e4/attachment.htm>


More information about the rails-dev mailing list