From: Tom Hughes Date: Tue, 9 Jan 2024 18:56:25 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/4466' X-Git-Tag: live~389 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ddd22cdda69a198afd298831bb8569e3315351e4?hp=c3f57537b46d1e4bb486322938384631e0fd6af9 Merge remote-tracking branch 'upstream/pull/4466' --- diff --git a/.rubocop.yml b/.rubocop.yml index 97bb72e0a..1e18afd83 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -37,9 +37,6 @@ Metrics/ClassLength: Metrics/ModuleLength: Max: 150 -Minitest/MultipleAssertions: - Enabled: false - Naming/FileName: Exclude: - 'script/deliver-message' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index deaea8e2d..8a196f52e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -14,6 +14,11 @@ require: - rubocop-rails - rubocop-rake +# Offense count: 11 +# Configuration parameters: Include, MaxAmount +FactoryBot/ExcessiveCreateList: + MaxAmount: 200 + # Offense count: 557 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. diff --git a/Gemfile.lock b/Gemfile.lock index aecaa7fdf..0135ebb87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,6 +3,7 @@ GEM specs: aasm (5.5.0) concurrent-ruby (~> 1.0) + abbrev (0.1.2) actioncable (7.1.2) actionpack (= 7.1.2) activesupport (= 7.1.2) @@ -95,13 +96,13 @@ GEM autoprefixer-rails (10.4.16.0) execjs (~> 2) aws-eventstream (1.3.0) - aws-partitions (1.876.0) + aws-partitions (1.877.0) aws-sdk-core (3.190.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.75.0) + aws-sdk-kms (1.76.0) aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.142.0) @@ -207,7 +208,8 @@ GEM dry-logic (>= 1.4, < 2) dry-types (>= 1.7, < 2) zeitwerk (~> 2.6) - dry-types (1.7.1) + dry-types (1.7.2) + bigdecimal (~> 3.0) concurrent-ruby (~> 1.0) dry-core (~> 1.0) dry-inflector (~> 1.0) @@ -234,11 +236,10 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (2.8.1) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http ffi (1.16.3) ffi-compiler (1.0.1) ffi (>= 1.0.0) @@ -253,10 +254,11 @@ GEM ffi (>= 1.0.0) globalid (1.2.1) activesupport (>= 6.1) - google-protobuf (3.25.1) + google-protobuf (3.25.2) hashdiff (1.1.0) hashie (5.0.0) - highline (2.1.0) + highline (3.0.0) + abbrev htmlentities (4.3.4) http_accept_language (2.1.1) i18n (1.14.1) @@ -290,9 +292,9 @@ GEM image_size (3.3.0) in_threads (1.6.0) io-console (0.7.1) - irb (1.11.0) + irb (1.11.1) rdoc - reline (>= 0.3.8) + reline (>= 0.4.2) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -308,7 +310,7 @@ GEM rexml language_server-protocol (3.17.0.3) libv8-node (18.16.0.0) - libxml-ruby (4.1.2) + libxml-ruby (5.0.2) listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -336,14 +338,16 @@ GEM multi_json (1.15.0) multi_xml (0.6.0) mutex_m (0.2.0) - net-imap (0.4.9) + net-http (0.4.1) + uri + net-imap (0.4.9.1) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.4.0.1) net-protocol nio4r (2.7.0) nokogiri (1.16.0) @@ -397,7 +401,7 @@ GEM omniauth (~> 2.0) openstreetmap-deadlock_retry (1.3.1) parallel (1.24.0) - parser (3.2.2.4) + parser (3.3.0.2) ast (~> 2.4.1) racc pg (1.5.4) @@ -406,7 +410,7 @@ GEM psych (5.1.2) stringio public_suffix (5.0.4) - puma (5.6.7) + puma (5.6.8) nio4r (~> 2.0) quad_tile (1.0.1) racc (1.7.3) @@ -470,8 +474,8 @@ GEM ffi (~> 1.0) rdoc (6.6.2) psych (>= 4.0.0) - regexp_parser (2.8.3) - reline (0.4.1) + regexp_parser (2.9.0) + reline (0.4.2) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) @@ -494,14 +498,14 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-capybara (2.19.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) rubocop (~> 1.41) - rubocop-factory_bot (2.24.0) - rubocop (~> 1.33) - rubocop-minitest (0.34.3) + rubocop-minitest (0.34.4) rubocop (>= 1.39, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) - rubocop-performance (1.20.1) + rubocop-performance (1.20.2) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) rubocop-rails (2.23.1) @@ -550,7 +554,7 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) stringio (3.1.0) - strong_migrations (1.6.4) + strong_migrations (1.7.0) activerecord (>= 5.2) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) @@ -562,6 +566,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + uri (0.13.0) validates_email_format_of (1.7.2) i18n vendorer (0.2.0) diff --git a/test/system/account_deletion_test.rb b/test/system/account_deletion_test.rb index e6517dccc..ca5ef7fe8 100644 --- a/test/system/account_deletion_test.rb +++ b/test/system/account_deletion_test.rb @@ -9,9 +9,9 @@ class AccountDeletionTest < ApplicationSystemTestCase test "the status is deleted and the personal data removed" do visit edit_account_path - click_link "Delete Account..." + click_on "Delete Account..." accept_confirm do - click_link "Delete Account" + click_on "Delete Account" end assert_current_path root_path @@ -23,9 +23,9 @@ class AccountDeletionTest < ApplicationSystemTestCase test "the user is signed out after deletion" do visit edit_account_path - click_link "Delete Account..." + click_on "Delete Account..." accept_confirm do - click_link "Delete Account" + click_on "Delete Account" end assert_content "Log In" @@ -34,9 +34,9 @@ class AccountDeletionTest < ApplicationSystemTestCase test "the user is shown a confirmation flash message" do visit edit_account_path - click_link "Delete Account..." + click_on "Delete Account..." accept_confirm do - click_link "Delete Account" + click_on "Delete Account" end assert_content "Account Deleted" @@ -47,7 +47,7 @@ class AccountDeletionTest < ApplicationSystemTestCase travel 1.hour do visit edit_account_path - click_link "Delete Account..." + click_on "Delete Account..." assert_no_content "cannot currently be deleted" end @@ -61,7 +61,7 @@ class AccountDeletionTest < ApplicationSystemTestCase travel 1.hour do visit edit_account_path - click_link "Delete Account..." + click_on "Delete Account..." assert_no_content "cannot currently be deleted" end @@ -75,7 +75,7 @@ class AccountDeletionTest < ApplicationSystemTestCase travel 12.hours do visit edit_account_path - click_link "Delete Account..." + click_on "Delete Account..." assert_no_content "cannot currently be deleted" end @@ -89,7 +89,7 @@ class AccountDeletionTest < ApplicationSystemTestCase travel 10.hours do visit edit_account_path - click_link "Delete Account..." + click_on "Delete Account..." assert_content "cannot currently be deleted" assert_content "in about 1 hour" diff --git a/test/system/confirmation_resend_test.rb b/test/system/confirmation_resend_test.rb index f615a6321..31b9ed7bb 100644 --- a/test/system/confirmation_resend_test.rb +++ b/test/system/confirmation_resend_test.rb @@ -5,16 +5,18 @@ class ConfirmationResendSystemTest < ApplicationSystemTestCase @user = build(:user) visit user_new_path - fill_in "Email", :with => @user.email - fill_in "Email Confirmation", :with => @user.email - fill_in "Display Name", :with => @user.display_name - fill_in "Password", :with => "testtest" - fill_in "Confirm Password", :with => "testtest" - click_button "Sign Up" + within ".new_user" do + fill_in "Email", :with => @user.email + fill_in "Email Confirmation", :with => @user.email + fill_in "Display Name", :with => @user.display_name + fill_in "Password", :with => "testtest" + fill_in "Confirm Password", :with => "testtest" + click_on "Sign Up" + end check "I have read and agree to the above contributor terms" check "I have read and agree to the Terms of Use" - click_button "Continue" + click_on "Continue" end test "flash message should not contain raw html" do diff --git a/test/system/diary_entry_test.rb b/test/system/diary_entry_test.rb index 290b94207..ba091c538 100644 --- a/test/system/diary_entry_test.rb +++ b/test/system/diary_entry_test.rb @@ -13,7 +13,7 @@ class DiaryEntrySystemTest < ApplicationSystemTestCase sign_in_as(create(:user)) visit diary_entries_path - click_link "Send a message to the author" + click_on "Send a message to the author" assert_content "Send a new message" assert_equal "Re: #{@diary_entry.title}", page.find_field("Subject").value diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb index a40306e3c..b9b989c07 100644 --- a/test/system/issues_test.rb +++ b/test/system/issues_test.rb @@ -80,21 +80,21 @@ class IssuesTest < ApplicationSystemTestCase # No issues against the user visit issues_path fill_in "search_by_user", :with => good_user.display_name - click_button "Search" + click_on "Search" assert_no_content I18n.t("issues.index.user_not_found") assert_content I18n.t("issues.index.issues_not_found") # User doesn't exist visit issues_path fill_in "search_by_user", :with => "Nonexistent User" - click_button "Search" + click_on "Search" assert_content I18n.t("issues.index.user_not_found") assert_content I18n.t("issues.index.issues_not_found") # Find Issue against bad_user visit issues_path fill_in "search_by_user", :with => bad_user.display_name - click_button "Search" + click_on "Search" assert_no_content I18n.t("issues.index.user_not_found") assert_no_content I18n.t("issues.index.issues_not_found") end @@ -106,7 +106,7 @@ class IssuesTest < ApplicationSystemTestCase visit issue_path(issue) fill_in :issue_comment_body, :with => "test comment" - click_button "Add Comment" + click_on "Add Comment" assert_content I18n.t("issue_comments.create.comment_created") assert_content "test comment" @@ -123,7 +123,7 @@ class IssuesTest < ApplicationSystemTestCase fill_in :issue_comment_body, :with => "reassigning to moderators" check :reassign - click_button "Add Comment" + click_on "Add Comment" assert_content "and the issue was reassigned" assert_current_path issues_path(:status => "open") @@ -140,7 +140,7 @@ class IssuesTest < ApplicationSystemTestCase fill_in :issue_comment_body, :with => "reassigning to moderators" check :reassign - click_button "Add Comment" + click_on "Add Comment" assert_content "and the issue was reassigned" assert_current_path issue_path(issue) diff --git a/test/system/messages_test.rb b/test/system/messages_test.rb index 60011e4d6..dea0d2208 100644 --- a/test/system/messages_test.rb +++ b/test/system/messages_test.rb @@ -9,7 +9,7 @@ class MessagesTest < ApplicationSystemTestCase visit inbox_messages_path assert_text "You have 1 new message and 0 old messages" - click_button "Delete" + click_on "Delete" assert_text "You have 0 new messages and 0 old messages" end @@ -21,7 +21,7 @@ class MessagesTest < ApplicationSystemTestCase visit outbox_messages_path assert_text "You have 1 sent message" - click_button "Delete" + click_on "Delete" assert_text "You have 0 sent messages" end @@ -35,7 +35,7 @@ class MessagesTest < ApplicationSystemTestCase visit muted_messages_path assert_text "1 muted message" - click_button "Delete" + click_on "Delete" assert_text "0 muted messages" end end diff --git a/test/system/note_comments_test.rb b/test/system/note_comments_test.rb index 7666f69e2..70cfc417c 100644 --- a/test/system/note_comments_test.rb +++ b/test/system/note_comments_test.rb @@ -34,7 +34,7 @@ class NoteCommentsTest < ApplicationSystemTestCase assert_button "Comment & Resolve" assert_button "Comment", :disabled => false - click_button "Comment" + click_on "Comment" assert_content "Comment from #{user.display_name}" assert_content "Some newly added note comment" diff --git a/test/system/oauth2_test.rb b/test/system/oauth2_test.rb index ed5ec1532..0b9213aaa 100644 --- a/test/system/oauth2_test.rb +++ b/test/system/oauth2_test.rb @@ -8,7 +8,7 @@ class Oauth2Test < ApplicationSystemTestCase assert_text "OpenStreetMap Web Site" accept_alert do - click_link "Revoke Access" + click_on "Revoke Access" end assert_text "You have not yet authorized any OAuth 2 applications." diff --git a/test/system/preferences_test.rb b/test/system/preferences_test.rb index b071b1f73..59a7209f5 100644 --- a/test/system/preferences_test.rb +++ b/test/system/preferences_test.rb @@ -5,7 +5,7 @@ class PreferencesTest < ApplicationSystemTestCase sign_in_as(create(:user)) visit edit_preferences_path - click_button "Update Preferences" + click_on "Update Preferences" assert_content "Preferences updated" end @@ -15,7 +15,7 @@ class PreferencesTest < ApplicationSystemTestCase visit edit_preferences_path fill_in "Preferred Languages", :with => "fr" - click_button "Update Preferences" + click_on "Update Preferences" assert_content "Préférences mises à jour" end diff --git a/test/system/report_diary_comment_test.rb b/test/system/report_diary_comment_test.rb index 15ef1ad3c..3504ab061 100644 --- a/test/system/report_diary_comment_test.rb +++ b/test/system/report_diary_comment_test.rb @@ -19,14 +19,14 @@ class ReportDiaryCommentTest < ApplicationSystemTestCase visit diary_entry_path(@diary_entry.user.display_name, @diary_entry) assert_content @diary_entry.title - click_link I18n.t("diary_entries.diary_comment.report") + click_on I18n.t("diary_entries.diary_comment.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.diary_comment.spam_label") fill_in "report_details", :with => "This comment is spam" assert_difference "Issue.count", 1 do - click_button "Create Report" + click_on "Create Report" end assert_content "Your report has been registered successfully" diff --git a/test/system/report_diary_entry_test.rb b/test/system/report_diary_entry_test.rb index 545723ebb..dde06cffc 100644 --- a/test/system/report_diary_entry_test.rb +++ b/test/system/report_diary_entry_test.rb @@ -18,14 +18,14 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase visit diary_entry_path(@diary_entry.user.display_name, @diary_entry) assert_content @diary_entry.title - click_link I18n.t("diary_entries.diary_entry.report") + click_on I18n.t("diary_entries.diary_entry.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.diary_entry.spam_label") fill_in "report_details", :with => "This is advertising" assert_difference "Issue.count", 1 do - click_button "Create Report" + click_on "Create Report" end assert_content "Your report has been registered successfully" @@ -42,14 +42,14 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase visit diary_entry_path(@diary_entry.user.display_name, @diary_entry) assert_content @diary_entry.title - click_link I18n.t("diary_entries.diary_entry.report") + click_on I18n.t("diary_entries.diary_entry.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.diary_entry.spam_label") fill_in "report_details", :with => "This is advertising" assert_no_difference "Issue.count" do - click_button "Create Report" + click_on "Create Report" end issue.reload diff --git a/test/system/report_note_test.rb b/test/system/report_note_test.rb index b7e1bfc9e..79894eb89 100644 --- a/test/system/report_note_test.rb +++ b/test/system/report_note_test.rb @@ -14,14 +14,14 @@ class ReportNoteTest < ApplicationSystemTestCase sign_in_as(create(:user)) visit note_path(note) - click_link I18n.t("notes.show.report") + click_on I18n.t("notes.show.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.note.spam_label") fill_in "report_details", :with => "This is spam" assert_difference "Issue.count", 1 do - click_button "Create Report" + click_on "Create Report" end assert_content "Your report has been registered successfully" @@ -35,14 +35,14 @@ class ReportNoteTest < ApplicationSystemTestCase sign_in_as(create(:user)) visit note_path(note) - click_link I18n.t("notes.show.report") + click_on I18n.t("notes.show.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.note.spam_label") fill_in "report_details", :with => "This is spam" assert_difference "Issue.count", 1 do - click_button "Create Report" + click_on "Create Report" end assert_content "Your report has been registered successfully" diff --git a/test/system/report_user_test.rb b/test/system/report_user_test.rb index 9a0abe9ea..7a9e800c8 100644 --- a/test/system/report_user_test.rb +++ b/test/system/report_user_test.rb @@ -14,14 +14,14 @@ class ReportUserTest < ApplicationSystemTestCase sign_in_as(create(:user)) visit user_path(user) - click_link I18n.t("users.show.report") + click_on I18n.t("users.show.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.user.vandal_label") fill_in "report_details", :with => "This user is a vandal" assert_difference "Issue.count", 1 do - click_button "Create Report" + click_on "Create Report" end assert_content "Your report has been registered successfully" @@ -35,14 +35,14 @@ class ReportUserTest < ApplicationSystemTestCase sign_in_as(create(:user)) visit user_path(user) - click_link I18n.t("users.show.report") + click_on I18n.t("users.show.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.user.vandal_label") fill_in "report_details", :with => "This user is a vandal" assert_difference "Issue.count", 1 do - click_button "Create Report" + click_on "Create Report" end assert_content "Your report has been registered successfully" @@ -52,14 +52,14 @@ class ReportUserTest < ApplicationSystemTestCase visit user_path(user) - click_link I18n.t("users.show.report") + click_on I18n.t("users.show.report") assert_content "Report" assert_content I18n.t("reports.new.disclaimer.intro") choose I18n.t("reports.new.categories.user.spam_label") fill_in "report_details", :with => "This user is a spammer" assert_no_difference "Issue.count" do - click_button "Create Report" + click_on "Create Report" end assert_content "Your report has been registered successfully" diff --git a/test/system/user_blocks_test.rb b/test/system/user_blocks_test.rb index 957ecb662..f710f74aa 100644 --- a/test/system/user_blocks_test.rb +++ b/test/system/user_blocks_test.rb @@ -45,7 +45,7 @@ class ReportNoteTest < ApplicationSystemTestCase visit user_path(blocked_user) assert_link "Revoke all blocks" - click_link "Revoke all blocks" + click_on "Revoke all blocks" assert_title "Revoking all blocks on #{blocked_user.display_name}" assert_text "Revoking all blocks on #{blocked_user.display_name}" assert_unchecked_field "Are you sure you wish to revoke 1 active block?" @@ -62,7 +62,7 @@ class ReportNoteTest < ApplicationSystemTestCase visit user_path(blocked_user) assert_link "Revoke all blocks" - click_link "Revoke all blocks" + click_on "Revoke all blocks" assert_title "Revoking all blocks on #{blocked_user.display_name}" assert_text "Revoking all blocks on #{blocked_user.display_name}" assert_unchecked_field "Are you sure you wish to revoke 2 active blocks?" diff --git a/test/system/user_logout_test.rb b/test/system/user_logout_test.rb index fc27b7c18..2f5331711 100644 --- a/test/system/user_logout_test.rb +++ b/test/system/user_logout_test.rb @@ -6,8 +6,8 @@ class UserLogoutTest < ApplicationSystemTestCase sign_in_as(user) assert_no_content "Log In" - click_button user.display_name - click_link "Log Out" + click_on user.display_name + click_on "Log Out" assert_content "Log In" end @@ -17,8 +17,8 @@ class UserLogoutTest < ApplicationSystemTestCase visit traces_path assert_no_content "Log In" - click_button user.display_name - click_link "Log Out" + click_on user.display_name + click_on "Log Out" assert_content "Log In" assert_content "Public GPS Traces" end @@ -30,7 +30,7 @@ class UserLogoutTest < ApplicationSystemTestCase visit logout_path assert_content "Logout from OpenStreetMap" - click_button "Logout" + click_on "Logout" assert_content "Log In" end @@ -41,7 +41,7 @@ class UserLogoutTest < ApplicationSystemTestCase visit logout_path(:referer => "/traces") assert_content "Logout from OpenStreetMap" - click_button "Logout" + click_on "Logout" assert_content "Log In" assert_content "Public GPS Traces" end diff --git a/test/system/user_muting_test.rb b/test/system/user_muting_test.rb index ce4346115..e70005e64 100644 --- a/test/system/user_muting_test.rb +++ b/test/system/user_muting_test.rb @@ -10,14 +10,14 @@ class UserMutingTest < ApplicationSystemTestCase sign_in_as(user) visit user_path(other_user) - click_link "Mute this User" + click_on "Mute this User" assert_content "You muted #{other_user.display_name}" visit edit_account_path assert_content "Muted Users" - click_link "Muted Users" + click_on "Muted Users" assert_content "You have muted 1 User" - click_link "Unmute" + click_on "Unmute" assert_content "You unmuted #{other_user.display_name}" refute_content "Muted Users" @@ -35,7 +35,7 @@ class UserMutingTest < ApplicationSystemTestCase fill_in "Body", :with => "some message" assert_no_emails do - click_button "Send" + click_on "Send" end message = Message.find_by(:sender => muted_user, :recipient => user) diff --git a/test/system/user_signup_test.rb b/test/system/user_signup_test.rb index 88899d710..e97046800 100644 --- a/test/system/user_signup_test.rb +++ b/test/system/user_signup_test.rb @@ -4,7 +4,7 @@ class UserSignupTest < ApplicationSystemTestCase test "Sign up from login page" do visit login_path - click_link "Register now" + click_on "Register now" assert_content "Confirm Password" end @@ -13,16 +13,19 @@ class UserSignupTest < ApplicationSystemTestCase user = build(:user) visit root_path - click_link "Sign Up" - fill_in "Email", :with => user.email - fill_in "Email Confirmation", :with => user.email - fill_in "Display Name", :with => user.display_name - fill_in "Password", :with => "testtest" - fill_in "Confirm Password", :with => "testtest" - click_button "Sign Up" + click_on "Sign Up" + + within ".new_user" do + fill_in "Email", :with => user.email + fill_in "Email Confirmation", :with => user.email + fill_in "Display Name", :with => user.display_name + fill_in "Password", :with => "testtest" + fill_in "Confirm Password", :with => "testtest" + click_on "Sign Up" + end assert_content "Contributor terms" - click_button "Cancel" + click_on "Cancel" assert_current_path "https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined" end diff --git a/test/system/user_status_change_test.rb b/test/system/user_status_change_test.rb index e4cca1eab..30b923732 100644 --- a/test/system/user_status_change_test.rb +++ b/test/system/user_status_change_test.rb @@ -10,7 +10,7 @@ class UserStatusChangeTest < ApplicationSystemTestCase user = create(:user, :suspended) visit user_path(user) accept_confirm do - click_link "Unsuspend" + click_on "Unsuspend" end assert_no_content "Unsuspend" @@ -22,7 +22,7 @@ class UserStatusChangeTest < ApplicationSystemTestCase user = create(:user, :suspended) visit user_path(user) accept_confirm do - click_link "Confirm" + click_on "Confirm" end assert_no_content "Unsuspend" diff --git a/test/system/view_communities_test.rb b/test/system/view_communities_test.rb index 539daaa30..349d0a5bf 100644 --- a/test/system/view_communities_test.rb +++ b/test/system/view_communities_test.rb @@ -13,7 +13,7 @@ class ViewCommunitiesTest < ApplicationSystemTestCase visit edit_preferences_path fill_in "Preferred Languages", :with => "fr" - click_button "Update Preferences" + click_on "Update Preferences" visit "/communities" assert_link "OpenStreetMap États-Unis", :href => "https://www.openstreetmap.us/" diff --git a/test/test_helper.rb b/test/test_helper.rb index 19e1a2784..9d06d2353 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -245,7 +245,7 @@ module ActiveSupport visit login_path fill_in "username", :with => user.email fill_in "password", :with => "test" - click_button "Login", :match => :first + click_on "Login", :match => :first end def session_for(user)