From: Anton Khorev Date: Mon, 13 Jan 2025 10:30:57 +0000 (+0300) Subject: Test that anonymous note encouragement disappears after login X-Git-Tag: live~9^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/fe214adbc6c35ee9f8edb492b1487981a46f7e30 Test that anonymous note encouragement disappears after login --- diff --git a/test/system/create_note_test.rb b/test/system/create_note_test.rb index 04f895219..f3a77e544 100644 --- a/test/system/create_note_test.rb +++ b/test/system/create_note_test.rb @@ -79,7 +79,7 @@ class CreateNoteTest < ApplicationSystemTestCase end end - test "encouragement to contribute appears after 10 created notes" do + test "encouragement to contribute appears after 10 created notes and disappears after login" do encouragement_threshold = 10 encouragement_threshold.times do |n| @@ -100,5 +100,19 @@ class CreateNoteTest < ApplicationSystemTestCase within_sidebar do assert_content(/already posted at least #{encouragement_threshold} anonymous note/) end + + sign_in_as(create(:user)) + visit new_note_path(:anchor => "map=16/0/#{0.001 * encouragement_threshold}") + + within_sidebar do + assert_no_content(/already posted at least \d+ anonymous note/) + end + + sign_out + visit new_note_path(:anchor => "map=16/0/#{0.001 * encouragement_threshold}") + + within_sidebar do + assert_no_content(/already posted at least \d+ anonymous note/) + end end end