From: Anton Khorev Date: Sat, 26 Apr 2025 16:01:02 +0000 (+0300) Subject: Don't visit profile page after tested profile location update X-Git-Tag: live~10^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/89c48a4bb483695ee04fa483c2625aa94782baba?ds=sidebyside;hp=--cc Don't visit profile page after tested profile location update The visit after clicking "Update Profile" is unnecessary because updating redirects to the profile page. Instead, assert that there's a "Profile updated" message. --- 89c48a4bb483695ee04fa483c2625aa94782baba diff --git a/test/system/user_location_change_test.rb b/test/system/user_location_change_test.rb index 5524c98f5..d35ac434d 100644 --- a/test/system/user_location_change_test.rb +++ b/test/system/user_location_change_test.rb @@ -10,13 +10,19 @@ class UserLocationChangeTest < ApplicationSystemTestCase sign_in_as(user) visit user_path(user) - assert_no_selector ".bi.bi-geo-alt-fill" + + within_content_heading do + assert_no_selector ".bi.bi-geo-alt-fill" + end visit edit_profile_path + fill_in "Home location name", :with => "Test Location" click_on "Update Profile" - visit user_path(user) - assert_text "Test Location" + assert_text "Profile updated" + within_content_heading do + assert_text "Test Location" + end end end