[openstreetmap/openstreetmap-website] Use resourceful routes for terms view/accept/decline (PR #5462)

Anton Khorev notifications at github.com
Wed Jan 8 19:23:08 UTC 2025


@AntonKhorev commented on this pull request.



> @@ -25,12 +25,12 @@ def test_terms_presented_at_login
     assert_template "sessions/new"
     post "/login", :params => { :username => user.email, :password => "test", :referer => "/diary/new" }
     # but now we need to look at the terms
-    assert_redirected_to :controller => :users, :action => :terms, :referer => "/diary/new"
+    assert_redirected_to "/account/terms?#{{ :referer => '/diary/new' }.to_query}"

The entire test didn't use path helpers and has path expressions like `"/api/#{Settings.api_version}/user/preferences"`. I wrote `"/account/terms?#{{ :referer => '/diary/new' }.to_query}"` in case that was on purpose.

Updated to `account_terms_path(:referer => "/diary/new")`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5462#discussion_r1907696577
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5462/review/2538016108 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250108/ecd42932/attachment.htm>


More information about the rails-dev mailing list