From 696aaa616bf3bcaa5423ea8379498da4a41310c6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 4 May 2026 03:52:29 -0400 Subject: [PATCH] Update rubocop-capybara to version 2.23.0 (#38868) --- Gemfile.lock | 4 +- spec/system/admin/account_actions_spec.rb | 2 +- .../admin/account_moderation_notes_spec.rb | 6 +-- spec/system/admin/accounts_spec.rb | 2 +- spec/system/admin/announcements_spec.rb | 12 +++--- spec/system/admin/confirmations_spec.rb | 2 +- spec/system/admin/custom_emojis_spec.rb | 10 ++--- spec/system/admin/dashboard_spec.rb | 4 +- spec/system/admin/domain_allows_spec.rb | 8 ++-- spec/system/admin/domain_blocks_spec.rb | 4 +- spec/system/admin/email_domain_blocks_spec.rb | 14 +++---- .../admin/follow_recommendations_spec.rb | 2 +- .../admin/instance/moderation_notes_spec.rb | 8 ++-- spec/system/admin/ip_blocks_spec.rb | 8 ++-- spec/system/admin/relays_spec.rb | 10 ++--- spec/system/admin/report_notes_spec.rb | 12 +++--- spec/system/admin/reports_spec.rb | 14 +++---- spec/system/admin/reset_spec.rb | 2 +- spec/system/admin/roles_spec.rb | 2 +- spec/system/admin/rules_spec.rb | 18 ++++---- spec/system/admin/settings/about_spec.rb | 2 +- spec/system/admin/settings/appearance_spec.rb | 2 +- spec/system/admin/settings/branding_spec.rb | 2 +- .../admin/settings/content_retention_spec.rb | 2 +- spec/system/admin/settings/discovery_spec.rb | 2 +- .../admin/settings/registrations_spec.rb | 2 +- spec/system/admin/site_uploads_spec.rb | 2 +- spec/system/admin/software_updates_spec.rb | 6 +-- spec/system/admin/statuses_spec.rb | 2 +- spec/system/admin/tags_spec.rb | 2 +- .../admin/terms_of_service/histories_spec.rb | 4 +- spec/system/admin/terms_of_service_spec.rb | 2 +- .../links/preview_card_providers_spec.rb | 2 +- spec/system/admin/trends/links_spec.rb | 2 +- spec/system/admin/trends/statuses_spec.rb | 2 +- spec/system/admin/trends/tags_spec.rb | 4 +- spec/system/admin/warning_presets_spec.rb | 8 ++-- spec/system/admin/webhooks_spec.rb | 14 +++---- spec/system/auth/registrations_spec.rb | 6 +-- spec/system/auth/setup_spec.rb | 4 +- spec/system/captcha_spec.rb | 2 +- spec/system/disputes/appeals_spec.rb | 4 +- spec/system/disputes/strikes_spec.rb | 2 +- spec/system/filters_spec.rb | 16 +++---- spec/system/invites_spec.rb | 4 +- spec/system/oauth_spec.rb | 42 +++++++++---------- spec/system/redirections_spec.rb | 4 +- spec/system/report_interface_spec.rb | 2 +- spec/system/settings/aliases_spec.rb | 10 ++--- spec/system/settings/applications_spec.rb | 24 +++++------ spec/system/settings/deletes_spec.rb | 4 +- spec/system/settings/exports_spec.rb | 4 +- spec/system/settings/login_activities_spec.rb | 6 +-- .../settings/migration/redirects_spec.rb | 2 +- spec/system/settings/migrations_spec.rb | 14 +++---- spec/system/settings/privacy_spec.rb | 10 ++--- spec/system/settings/sessions_spec.rb | 2 +- .../recovery_codes_spec.rb | 4 +- .../two_factor_authentication_methods_spec.rb | 4 +- spec/system/settings/verifications_spec.rb | 10 ++--- spec/system/statuses_cleanup_spec.rb | 2 +- 61 files changed, 194 insertions(+), 194 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 67203c6b04..f28240ce2f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -770,9 +770,9 @@ GEM rubocop-ast (1.49.1) parser (>= 3.3.7.2) prism (~> 1.7) - rubocop-capybara (2.22.1) + rubocop-capybara (2.23.0) lint_roller (~> 1.1) - rubocop (~> 1.72, >= 1.72.1) + rubocop (~> 1.81) rubocop-i18n (3.3.0) lint_roller (~> 1.1) rubocop (>= 1.72.1) diff --git a/spec/system/admin/account_actions_spec.rb b/spec/system/admin/account_actions_spec.rb index abfd33dc27..bd24ddebe1 100644 --- a/spec/system/admin/account_actions_spec.rb +++ b/spec/system/admin/account_actions_spec.rb @@ -19,7 +19,7 @@ RSpec.describe 'Admin Account Actions' do expect { submit_form } .to_not(change { account.strikes.count }) expect(page) - .to have_content(/can't be blank/) + .to have_text(/can't be blank/) # Valid submission choose(option: 'silence') diff --git a/spec/system/admin/account_moderation_notes_spec.rb b/spec/system/admin/account_moderation_notes_spec.rb index 728d171474..c1254638f5 100644 --- a/spec/system/admin/account_moderation_notes_spec.rb +++ b/spec/system/admin/account_moderation_notes_spec.rb @@ -16,18 +16,18 @@ RSpec.describe 'Admin::AccountModerationNotes' do expect { submit_form } .to not_change(AccountModerationNote, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) fill_in 'account_moderation_note_content', with: 'Test message' expect { submit_form } .to change(AccountModerationNote, :count).by(1) expect(page) - .to have_content(I18n.t('admin.account_moderation_notes.created_msg')) + .to have_text(I18n.t('admin.account_moderation_notes.created_msg')) expect { delete_note } .to change(AccountModerationNote, :count).by(-1) expect(page) - .to have_content(I18n.t('admin.account_moderation_notes.destroyed_msg')) + .to have_text(I18n.t('admin.account_moderation_notes.destroyed_msg')) end def submit_form diff --git a/spec/system/admin/accounts_spec.rb b/spec/system/admin/accounts_spec.rb index 30504ce5d7..b85a0bf0bf 100644 --- a/spec/system/admin/accounts_spec.rb +++ b/spec/system/admin/accounts_spec.rb @@ -24,7 +24,7 @@ RSpec.describe 'Admin::Accounts' do it 'displays a notice about account selection' do click_on button_for_suspend - expect(page).to have_content(selection_error_text) + expect(page).to have_text(selection_error_text) end end diff --git a/spec/system/admin/announcements_spec.rb b/spec/system/admin/announcements_spec.rb index c1cb00cd84..104e624eb3 100644 --- a/spec/system/admin/announcements_spec.rb +++ b/spec/system/admin/announcements_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Admin::Announcements' do within css_id(announcement) do expect(page) - .to have_content(announcement.text) + .to have_text(announcement.text) end end end @@ -29,7 +29,7 @@ RSpec.describe 'Admin::Announcements' do expect { submit_form } .to change(Announcement, :count).by(1) expect(page) - .to have_content(I18n.t('admin.announcements.published_msg')) + .to have_text(I18n.t('admin.announcements.published_msg')) end end @@ -48,7 +48,7 @@ RSpec.describe 'Admin::Announcements' do click_on submit_button expect(page) - .to have_content(I18n.t('admin.announcements.updated_msg')) + .to have_text(I18n.t('admin.announcements.updated_msg')) end end @@ -62,7 +62,7 @@ RSpec.describe 'Admin::Announcements' do .to change(Announcement, :count).by(-1) expect(page) - .to have_content(I18n.t('admin.announcements.destroyed_msg')) + .to have_text(I18n.t('admin.announcements.destroyed_msg')) end end @@ -76,7 +76,7 @@ RSpec.describe 'Admin::Announcements' do .to change { announcement.reload.published? }.to(true) expect(page) - .to have_content(I18n.t('admin.announcements.published_msg')) + .to have_text(I18n.t('admin.announcements.published_msg')) end it 'unpublishes an existing announcement' do @@ -88,7 +88,7 @@ RSpec.describe 'Admin::Announcements' do .to change { announcement.reload.published? }.to(false) expect(page) - .to have_content(I18n.t('admin.announcements.unpublished_msg')) + .to have_text(I18n.t('admin.announcements.unpublished_msg')) end end diff --git a/spec/system/admin/confirmations_spec.rb b/spec/system/admin/confirmations_spec.rb index b0f2eed144..de2a80b1ab 100644 --- a/spec/system/admin/confirmations_spec.rb +++ b/spec/system/admin/confirmations_spec.rb @@ -40,7 +40,7 @@ RSpec.describe 'Admin Confirmations' do .to send_email(to: user.email) expect(page) .to have_title(I18n.t('admin.accounts.title')) - .and have_content(I18n.t('admin.accounts.resend_confirmation.success')) + .and have_text(I18n.t('admin.accounts.resend_confirmation.success')) end end diff --git a/spec/system/admin/custom_emojis_spec.rb b/spec/system/admin/custom_emojis_spec.rb index 1d54aa4d5e..4106e1cd69 100644 --- a/spec/system/admin/custom_emojis_spec.rb +++ b/spec/system/admin/custom_emojis_spec.rb @@ -14,8 +14,8 @@ RSpec.describe 'Admin::CustomEmojis' do visit admin_custom_emojis_path expect(page) - .to have_content(I18n.t('admin.custom_emojis.title')) - .and have_content(custom_emoji.shortcode) + .to have_text(I18n.t('admin.custom_emojis.title')) + .and have_text(custom_emoji.shortcode) end end @@ -23,12 +23,12 @@ RSpec.describe 'Admin::CustomEmojis' do it 'saves a new emoji record with valid attributes' do visit new_admin_custom_emoji_path expect(page) - .to have_content(I18n.t('admin.custom_emojis.title')) + .to have_text(I18n.t('admin.custom_emojis.title')) expect { submit_form } .to_not change(CustomEmoji, :count) expect(page) - .to have_content(/errors below/) + .to have_text(/errors below/) fill_in I18n.t('admin.custom_emojis.shortcode'), with: 'test' @@ -53,7 +53,7 @@ RSpec.describe 'Admin::CustomEmojis' do it 'displays a notice about selection' do click_on button_for_enable - expect(page).to have_content(selection_error_text) + expect(page).to have_text(selection_error_text) end end diff --git a/spec/system/admin/dashboard_spec.rb b/spec/system/admin/dashboard_spec.rb index d0cedd2ed1..8f21fd1320 100644 --- a/spec/system/admin/dashboard_spec.rb +++ b/spec/system/admin/dashboard_spec.rb @@ -18,8 +18,8 @@ RSpec.describe 'Admin Dashboard' do expect(page) .to have_title(I18n.t('admin.dashboard.title')) - .and have_content(I18n.t('admin.system_checks.software_version_patch_check.message_html')) - .and have_content('0 pending hashtags') + .and have_text(I18n.t('admin.system_checks.software_version_patch_check.message_html')) + .and have_text('0 pending hashtags') end private diff --git a/spec/system/admin/domain_allows_spec.rb b/spec/system/admin/domain_allows_spec.rb index b2e4b9576f..954aaadd92 100644 --- a/spec/system/admin/domain_allows_spec.rb +++ b/spec/system/admin/domain_allows_spec.rb @@ -27,28 +27,28 @@ RSpec.describe 'Admin::DomainAllows' do visit new_admin_domain_allow_path click_on I18n.t('admin.domain_allows.add_new') expect(page) - .to have_content(I18n.t('admin.domain_allows.add_new')) + .to have_text(I18n.t('admin.domain_allows.add_new')) # Submit invalid with missing domain fill_in 'domain_allow_domain', with: '' expect { submit_form } .to not_change(DomainAllow, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) # Submit valid with domain present fill_in 'domain_allow_domain', with: domain expect { submit_form } .to change(DomainAllow, :count).by(1) expect(page) - .to have_content(I18n.t('admin.domain_allows.created_msg')) + .to have_text(I18n.t('admin.domain_allows.created_msg')) # Visit instance page and delete the domain allow visit admin_instance_path(domain) expect { delete_domain_allow } .to change(DomainAllow, :count).by(-1) expect(page) - .to have_content(I18n.t('admin.domain_allows.destroyed_msg')) + .to have_text(I18n.t('admin.domain_allows.destroyed_msg')) end def submit_form diff --git a/spec/system/admin/domain_blocks_spec.rb b/spec/system/admin/domain_blocks_spec.rb index c309e39a4f..d9b036fca2 100644 --- a/spec/system/admin/domain_blocks_spec.rb +++ b/spec/system/admin/domain_blocks_spec.rb @@ -66,7 +66,7 @@ RSpec.describe 'blocking domains through the moderation interface' do submit_domain_block('example.com', 'noop') expect(page) - .to have_content(/You have already imposed stricter limits on example.com/) + .to have_text(/You have already imposed stricter limits on example.com/) end end @@ -77,7 +77,7 @@ RSpec.describe 'blocking domains through the moderation interface' do submit_domain_block('', 'noop') expect(page) - .to have_content(/review the error below/) + .to have_text(/review the error below/) end end diff --git a/spec/system/admin/email_domain_blocks_spec.rb b/spec/system/admin/email_domain_blocks_spec.rb index e88811ac49..393e1a21c7 100644 --- a/spec/system/admin/email_domain_blocks_spec.rb +++ b/spec/system/admin/email_domain_blocks_spec.rb @@ -15,24 +15,24 @@ RSpec.describe 'Admin::EmailDomainBlocks' do it 'views and creates new blocks' do visit admin_email_domain_blocks_path expect(page) - .to have_content(I18n.t('admin.email_domain_blocks.title')) - .and have_content(email_domain_block.domain) + .to have_text(I18n.t('admin.email_domain_blocks.title')) + .and have_text(email_domain_block.domain) click_on I18n.t('admin.email_domain_blocks.add_new') expect(page) - .to have_content(I18n.t('admin.email_domain_blocks.new.title')) + .to have_text(I18n.t('admin.email_domain_blocks.new.title')) fill_in I18n.t('admin.email_domain_blocks.domain'), with: 'example.com' expect { submit_resolve } .to_not change(EmailDomainBlock, :count) expect(page) - .to have_content(I18n.t('admin.email_domain_blocks.new.title')) + .to have_text(I18n.t('admin.email_domain_blocks.new.title')) expect { submit_create } .to change(EmailDomainBlock.where(domain: 'example.com'), :count).by(1) expect(page) - .to have_content(I18n.t('admin.email_domain_blocks.title')) - .and have_content(I18n.t('admin.email_domain_blocks.created_msg')) + .to have_text(I18n.t('admin.email_domain_blocks.title')) + .and have_text(I18n.t('admin.email_domain_blocks.created_msg')) end def submit_resolve @@ -53,7 +53,7 @@ RSpec.describe 'Admin::EmailDomainBlocks' do it 'displays a notice about selection' do click_on button_for_delete - expect(page).to have_content(selection_error_text) + expect(page).to have_text(selection_error_text) end end diff --git a/spec/system/admin/follow_recommendations_spec.rb b/spec/system/admin/follow_recommendations_spec.rb index 141a0f8152..22f4ca7020 100644 --- a/spec/system/admin/follow_recommendations_spec.rb +++ b/spec/system/admin/follow_recommendations_spec.rb @@ -12,7 +12,7 @@ RSpec.describe 'Admin Follow Recommendations' do visit admin_follow_recommendations_path expect(page) - .to have_content(I18n.t('admin.follow_recommendations.title')) + .to have_text(I18n.t('admin.follow_recommendations.title')) end end end diff --git a/spec/system/admin/instance/moderation_notes_spec.rb b/spec/system/admin/instance/moderation_notes_spec.rb index f8bf575b82..bf76caa13e 100644 --- a/spec/system/admin/instance/moderation_notes_spec.rb +++ b/spec/system/admin/instance/moderation_notes_spec.rb @@ -16,13 +16,13 @@ RSpec.describe 'Admin::Instances::ModerationNotesController' do expect { submit_form } .to not_change(InstanceModerationNote, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) fill_in 'instance_moderation_note_content', with: 'Test message ' * InstanceModerationNote::CONTENT_SIZE_LIMIT expect { submit_form } .to not_change(InstanceModerationNote, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) fill_in 'instance_moderation_note_content', with: 'Test message' expect { submit_form } @@ -30,12 +30,12 @@ RSpec.describe 'Admin::Instances::ModerationNotesController' do expect(page) .to have_current_path(admin_instance_path(instance_domain)) expect(page) - .to have_content(I18n.t('admin.instances.moderation_notes.created_msg')) + .to have_text(I18n.t('admin.instances.moderation_notes.created_msg')) expect { delete_note } .to change(InstanceModerationNote, :count).by(-1) expect(page) - .to have_content(I18n.t('admin.instances.moderation_notes.destroyed_msg')) + .to have_text(I18n.t('admin.instances.moderation_notes.destroyed_msg')) end def submit_form diff --git a/spec/system/admin/ip_blocks_spec.rb b/spec/system/admin/ip_blocks_spec.rb index 3bed506b68..3f99ec0050 100644 --- a/spec/system/admin/ip_blocks_spec.rb +++ b/spec/system/admin/ip_blocks_spec.rb @@ -12,7 +12,7 @@ RSpec.describe 'Admin::IpBlocks' do # Visit index page visit admin_ip_blocks_path expect(page) - .to have_content(I18n.t('admin.ip_blocks.title')) + .to have_text(I18n.t('admin.ip_blocks.title')) # Navigate to new click_on I18n.t('admin.ip_blocks.add_new') @@ -22,14 +22,14 @@ RSpec.describe 'Admin::IpBlocks' do expect { submit_form } .to_not change(IpBlock, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) # Valid with IP fill_in 'ip_block_ip', with: '192.168.1.1' expect { submit_form } .to change(IpBlock, :count).by(1) expect(page) - .to have_content(I18n.t('admin.ip_blocks.created_msg')) + .to have_text(I18n.t('admin.ip_blocks.created_msg')) end def submit_form @@ -44,7 +44,7 @@ RSpec.describe 'Admin::IpBlocks' do click_on button_for_delete expect(page) - .to have_content(selection_error_text) + .to have_text(selection_error_text) end end diff --git a/spec/system/admin/relays_spec.rb b/spec/system/admin/relays_spec.rb index a5b92a4d0d..cd935c5bbf 100644 --- a/spec/system/admin/relays_spec.rb +++ b/spec/system/admin/relays_spec.rb @@ -13,8 +13,8 @@ RSpec.describe 'Admin Relays' do visit admin_relays_path expect(page) - .to have_content(I18n.t('admin.relays.title')) - .and have_content(relay.inbox_url) + .to have_text(I18n.t('admin.relays.title')) + .and have_text(relay.inbox_url) end end @@ -25,21 +25,21 @@ RSpec.describe 'Admin Relays' do # Visit new page click_on I18n.t('admin.relays.setup') expect(page) - .to have_content(I18n.t('admin.relays.add_new')) + .to have_text(I18n.t('admin.relays.add_new')) # Invalid submission fill_in 'relay_inbox_url', with: '' expect { submit_form } .to_not change(Relay, :count) expect(page) - .to have_content(/errors below/) + .to have_text(/errors below/) # Valid submission fill_in 'relay_inbox_url', with: 'https://host.example/hooks/123' expect { submit_form } .to change(Relay, :count).by(1) expect(page) - .to have_content(I18n.t('admin.relays.title')) + .to have_text(I18n.t('admin.relays.title')) end def submit_form diff --git a/spec/system/admin/report_notes_spec.rb b/spec/system/admin/report_notes_spec.rb index 143bc8ac7c..b2f90568ce 100644 --- a/spec/system/admin/report_notes_spec.rb +++ b/spec/system/admin/report_notes_spec.rb @@ -21,7 +21,7 @@ RSpec.describe 'Admin Report Notes' do expect(report.reload) .to be_action_taken expect(page) - .to have_content(success_message) + .to have_text(success_message) end def submit_form @@ -39,7 +39,7 @@ RSpec.describe 'Admin Report Notes' do expect(report.reload) .to_not be_action_taken expect(page) - .to have_content(success_message) + .to have_text(success_message) end def submit_form @@ -61,7 +61,7 @@ RSpec.describe 'Admin Report Notes' do expect(report.reload) .to_not be_action_taken expect(page) - .to have_content(success_message) + .to have_text(success_message) end def submit_form @@ -79,7 +79,7 @@ RSpec.describe 'Admin Report Notes' do expect(report.reload) .to be_action_taken expect(page) - .to have_content(success_message) + .to have_text(success_message) end def submit_form @@ -98,7 +98,7 @@ RSpec.describe 'Admin Report Notes' do expect { submit_form } .to_not change(ReportNote, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) end def submit_form @@ -120,7 +120,7 @@ RSpec.describe 'Admin Report Notes' do expect { delete_note } .to change(ReportNote, :count).by(-1) expect(page) - .to have_content(I18n.t('admin.report_notes.destroyed_msg')) + .to have_text(I18n.t('admin.report_notes.destroyed_msg')) end def delete_note diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 90845a02f7..5f266b211c 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -16,19 +16,19 @@ RSpec.describe 'Admin Reports' do visit admin_reports_path expect(page) - .to have_content(unresolved_report.comment) - .and have_no_content(resolved_report.comment) + .to have_text(unresolved_report.comment) + .and have_no_text(resolved_report.comment) click_on I18n.t('admin.reports.resolved') expect(page) - .to have_content(resolved_report.comment) - .and have_no_content(unresolved_report.comment) + .to have_text(resolved_report.comment) + .and have_no_text(unresolved_report.comment) click_on resolved_report.comment expect(page) .to have_title(I18n.t('admin.reports.report', id: resolved_report.id)) - .and have_content(resolved_report.comment) - .and have_content(report_note.content) + .and have_text(resolved_report.comment) + .and have_text(report_note.content) end end @@ -43,7 +43,7 @@ RSpec.describe 'Admin Reports' do expect(page) .to have_title(I18n.t('admin.reports.title')) - .and have_content(I18n.t('admin.reports.resolved_msg')) + .and have_text(I18n.t('admin.reports.resolved_msg')) report.reload expect(report.action_taken_by_account) diff --git a/spec/system/admin/reset_spec.rb b/spec/system/admin/reset_spec.rb index 77f97c2eeb..741a2c1567 100644 --- a/spec/system/admin/reset_spec.rb +++ b/spec/system/admin/reset_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'Admin::Reset' do end.to change(Admin::ActionLog.where(target: account.user), :count).by(1) expect(page) - .to have_content(account.username) + .to have_text(account.username) end def admin_user diff --git a/spec/system/admin/roles_spec.rb b/spec/system/admin/roles_spec.rb index 2a82d80b71..8765bc9967 100644 --- a/spec/system/admin/roles_spec.rb +++ b/spec/system/admin/roles_spec.rb @@ -43,7 +43,7 @@ RSpec.describe 'Admin::Roles' do expect { click_on I18n.t('admin.roles.add_new') } .to_not change(UserRole, :count) expect(page) - .to have_content(I18n.t('activerecord.errors.models.user_role.attributes.position.elevated')) + .to have_text(I18n.t('activerecord.errors.models.user_role.attributes.position.elevated')) # Valid submission fill_in 'user_role_name', with: 'Baz' diff --git a/spec/system/admin/rules_spec.rb b/spec/system/admin/rules_spec.rb index dca6323f6c..b40a6035da 100644 --- a/spec/system/admin/rules_spec.rb +++ b/spec/system/admin/rules_spec.rb @@ -13,12 +13,12 @@ RSpec.describe 'Admin Rules' do visit admin_rules_path expect(page) - .to have_content(I18n.t('admin.rules.title')) - .and have_content(rule.text) + .to have_text(I18n.t('admin.rules.title')) + .and have_text(rule.text) click_on(rule.text) expect(page) - .to have_content(I18n.t('admin.rules.title')) + .to have_text(I18n.t('admin.rules.title')) end end @@ -33,14 +33,14 @@ RSpec.describe 'Admin Rules' do expect { submit_form } .to_not change(Rule, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) # Valid submission fill_in 'rule_text', with: 'No yelling on the bus!' expect { submit_form } .to change(Rule, :count).by(1) expect(page) - .to have_content(I18n.t('admin.rules.title')) + .to have_text(I18n.t('admin.rules.title')) end def submit_form @@ -56,16 +56,16 @@ RSpec.describe 'Admin Rules' do visit admin_rules_path expect(page) - .to have_content(I18n.t('admin.rules.title')) + .to have_text(I18n.t('admin.rules.title')) expect(Rule.ordered.pluck(:text)).to eq ['This is another rule', 'This is a rule'] click_on(I18n.t('admin.rules.move_down')) expect(page) - .to have_content(I18n.t('admin.rules.title')) - .and have_content(first_rule.text) - .and have_content(second_rule.text) + .to have_text(I18n.t('admin.rules.title')) + .and have_text(first_rule.text) + .and have_text(second_rule.text) expect(Rule.ordered.pluck(:text)).to eq ['This is a rule', 'This is another rule'] end diff --git a/spec/system/admin/settings/about_spec.rb b/spec/system/admin/settings/about_spec.rb index 93ee3f6864..e46020f147 100644 --- a/spec/system/admin/settings/about_spec.rb +++ b/spec/system/admin/settings/about_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Admin::Settings::About' do click_on submit_button expect(page) - .to have_content(success_message) + .to have_text(success_message) end def extended_description_field diff --git a/spec/system/admin/settings/appearance_spec.rb b/spec/system/admin/settings/appearance_spec.rb index 2f6e67979e..b09115dd0a 100644 --- a/spec/system/admin/settings/appearance_spec.rb +++ b/spec/system/admin/settings/appearance_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Admin::Settings::Appearance' do click_on submit_button expect(page) - .to have_content(success_message) + .to have_text(success_message) end def custom_css_field diff --git a/spec/system/admin/settings/branding_spec.rb b/spec/system/admin/settings/branding_spec.rb index 78364669e9..9405bcecd0 100644 --- a/spec/system/admin/settings/branding_spec.rb +++ b/spec/system/admin/settings/branding_spec.rb @@ -25,7 +25,7 @@ RSpec.describe 'Admin::Settings::Branding' do .to change(Setting, :site_short_description).to('new key value') expect(page) - .to have_content(success_message) + .to have_text(success_message) end def short_description_field diff --git a/spec/system/admin/settings/content_retention_spec.rb b/spec/system/admin/settings/content_retention_spec.rb index b813c4fa5b..a724202c85 100644 --- a/spec/system/admin/settings/content_retention_spec.rb +++ b/spec/system/admin/settings/content_retention_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Admin::Settings::ContentRetention' do click_on submit_button expect(page) - .to have_content(success_message) + .to have_text(success_message) end def media_cache_retention_period_field diff --git a/spec/system/admin/settings/discovery_spec.rb b/spec/system/admin/settings/discovery_spec.rb index f6909da9be..04618f0718 100644 --- a/spec/system/admin/settings/discovery_spec.rb +++ b/spec/system/admin/settings/discovery_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Admin::Settings::Discovery' do click_on submit_button expect(page) - .to have_content(success_message) + .to have_text(success_message) end def trends_box diff --git a/spec/system/admin/settings/registrations_spec.rb b/spec/system/admin/settings/registrations_spec.rb index 9b8bef4172..35c99d6a9a 100644 --- a/spec/system/admin/settings/registrations_spec.rb +++ b/spec/system/admin/settings/registrations_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Admin::Settings::Registrations' do click_on submit_button expect(page) - .to have_content(success_message) + .to have_text(success_message) end def open_mode_option diff --git a/spec/system/admin/site_uploads_spec.rb b/spec/system/admin/site_uploads_spec.rb index 5cbd8d275c..c4f4136777 100644 --- a/spec/system/admin/site_uploads_spec.rb +++ b/spec/system/admin/site_uploads_spec.rb @@ -20,7 +20,7 @@ RSpec.describe 'Admin SiteUploads' do expect { site_upload.reload } .to raise_error(ActiveRecord::RecordNotFound) expect(page) - .to have_content(I18n.t('admin.site_uploads.destroyed_msg')) + .to have_text(I18n.t('admin.site_uploads.destroyed_msg')) .and have_title(I18n.t('admin.settings.branding.title')) end end diff --git a/spec/system/admin/software_updates_spec.rb b/spec/system/admin/software_updates_spec.rb index 7eec0c659d..876fed874d 100644 --- a/spec/system/admin/software_updates_spec.rb +++ b/spec/system/admin/software_updates_spec.rb @@ -15,9 +15,9 @@ RSpec.describe 'finding software updates through the admin interface' do expect(page) .to have_title(I18n.t('admin.software_updates.title')) - .and have_content(latest_release.version) - .and have_content(other_release.version) - .and have_no_content(outdated_release.version) + .and have_text(latest_release.version) + .and have_text(other_release.version) + .and have_no_text(outdated_release.version) within("#software_update_#{latest_release.id}") do click_on I18n.t('admin.software_updates.release_notes') diff --git a/spec/system/admin/statuses_spec.rb b/spec/system/admin/statuses_spec.rb index 998ffc89df..369718f44c 100644 --- a/spec/system/admin/statuses_spec.rb +++ b/spec/system/admin/statuses_spec.rb @@ -19,7 +19,7 @@ RSpec.describe 'Admin::Statuses' do it 'displays a notice about selection' do click_on button_for_report - expect(page).to have_content(selection_error_text) + expect(page).to have_text(selection_error_text) end end diff --git a/spec/system/admin/tags_spec.rb b/spec/system/admin/tags_spec.rb index 654fac3340..74013c8ca7 100644 --- a/spec/system/admin/tags_spec.rb +++ b/spec/system/admin/tags_spec.rb @@ -20,7 +20,7 @@ RSpec.describe 'Admin Tags' do expect { click_on submit_button } .to_not(change { tag.reload.display_name }) expect(page) - .to have_content(match_error_text) + .to have_text(match_error_text) fill_in display_name_field, with: 'TEST' expect { click_on submit_button } diff --git a/spec/system/admin/terms_of_service/histories_spec.rb b/spec/system/admin/terms_of_service/histories_spec.rb index aa59550d09..6969ed3e52 100644 --- a/spec/system/admin/terms_of_service/histories_spec.rb +++ b/spec/system/admin/terms_of_service/histories_spec.rb @@ -14,8 +14,8 @@ RSpec.describe 'Admin Terms of Service Histories' do visit admin_terms_of_service_history_path expect(page) - .to have_content(I18n.t('admin.terms_of_service.history')) - .and have_content(/changelog notes from v1/) + .to have_text(I18n.t('admin.terms_of_service.history')) + .and have_text(/changelog notes from v1/) end end end diff --git a/spec/system/admin/terms_of_service_spec.rb b/spec/system/admin/terms_of_service_spec.rb index 0842138034..1d9723089f 100644 --- a/spec/system/admin/terms_of_service_spec.rb +++ b/spec/system/admin/terms_of_service_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'Admin Terms of services' do .to have_title(I18n.t('admin.terms_of_service.title')) expect(page) - .to have_content(terms.text) + .to have_text(terms.text) end end end diff --git a/spec/system/admin/trends/links/preview_card_providers_spec.rb b/spec/system/admin/trends/links/preview_card_providers_spec.rb index 4636ca86b2..23e1c3d425 100644 --- a/spec/system/admin/trends/links/preview_card_providers_spec.rb +++ b/spec/system/admin/trends/links/preview_card_providers_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Admin::Trends::Links::PreviewCardProviders' do click_on button_for_allow expect(page) - .to have_content(selection_error_text) + .to have_text(selection_error_text) end end diff --git a/spec/system/admin/trends/links_spec.rb b/spec/system/admin/trends/links_spec.rb index 6140ea8154..2d5a1b0409 100644 --- a/spec/system/admin/trends/links_spec.rb +++ b/spec/system/admin/trends/links_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Admin::Trends::Links' do click_on button_for_allow expect(page) - .to have_content(selection_error_text) + .to have_text(selection_error_text) end end diff --git a/spec/system/admin/trends/statuses_spec.rb b/spec/system/admin/trends/statuses_spec.rb index 6e1aa17b7d..ef764d801f 100644 --- a/spec/system/admin/trends/statuses_spec.rb +++ b/spec/system/admin/trends/statuses_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Admin::Trends::Statuses' do click_on button_for_allow expect(page) - .to have_content(selection_error_text) + .to have_text(selection_error_text) end end diff --git a/spec/system/admin/trends/tags_spec.rb b/spec/system/admin/trends/tags_spec.rb index 631288d4fc..a1cb823b6f 100644 --- a/spec/system/admin/trends/tags_spec.rb +++ b/spec/system/admin/trends/tags_spec.rb @@ -16,7 +16,7 @@ RSpec.describe 'Admin::Trends::Tags' do within('.filter-subset') do expect(page) - .to have_content("#{I18n.t('admin.accounts.moderation.pending')} (0)") + .to have_text("#{I18n.t('admin.accounts.moderation.pending')} (0)") end end end @@ -31,7 +31,7 @@ RSpec.describe 'Admin::Trends::Tags' do click_on button_for_allow - expect(page).to have_content(selection_error_text) + expect(page).to have_text(selection_error_text) end end diff --git a/spec/system/admin/warning_presets_spec.rb b/spec/system/admin/warning_presets_spec.rb index 88c697b743..cd5c591c4a 100644 --- a/spec/system/admin/warning_presets_spec.rb +++ b/spec/system/admin/warning_presets_spec.rb @@ -13,8 +13,8 @@ RSpec.describe 'Admin Warning Presets' do visit admin_warning_presets_path expect(page) - .to have_content(I18n.t('admin.warning_presets.title')) - .and have_content(account_warning_preset.text) + .to have_text(I18n.t('admin.warning_presets.title')) + .and have_text(account_warning_preset.text) end end @@ -27,14 +27,14 @@ RSpec.describe 'Admin Warning Presets' do expect { submit_form } .to_not change(AccountWarningPreset, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) # Valid submission fill_in 'account_warning_preset_text', with: 'You cant do that here' expect { submit_form } .to change(AccountWarningPreset, :count).by(1) expect(page) - .to have_content(I18n.t('admin.warning_presets.title')) + .to have_text(I18n.t('admin.warning_presets.title')) end def submit_form diff --git a/spec/system/admin/webhooks_spec.rb b/spec/system/admin/webhooks_spec.rb index 709752dc9c..eeaaa4e8b9 100644 --- a/spec/system/admin/webhooks_spec.rb +++ b/spec/system/admin/webhooks_spec.rb @@ -13,12 +13,12 @@ RSpec.describe 'Admin Webhooks' do visit admin_webhooks_path expect(page) - .to have_content(I18n.t('admin.webhooks.title')) - .and have_content(webhook.url) + .to have_text(I18n.t('admin.webhooks.title')) + .and have_text(webhook.url) click_on(webhook.url) expect(page) - .to have_content(I18n.t('admin.webhooks.title')) + .to have_text(I18n.t('admin.webhooks.title')) end end @@ -29,14 +29,14 @@ RSpec.describe 'Admin Webhooks' do # Visit new page click_on I18n.t('admin.webhooks.add_new') expect(page) - .to have_content(I18n.t('admin.webhooks.new')) + .to have_text(I18n.t('admin.webhooks.new')) # Invalid submission (missing url, no events selected) fill_in 'webhook_url', with: '' expect { submit_form } .to_not change(Webhook, :count) expect(page) - .to have_content(/errors below/) + .to have_text(/errors below/) # Valid submission fill_in 'webhook_url', with: 'https://host.example/hooks/123' @@ -44,7 +44,7 @@ RSpec.describe 'Admin Webhooks' do expect { submit_form } .to change(Webhook, :count).by(1) expect(page) - .to have_content(I18n.t('admin.webhooks.title')) + .to have_text(I18n.t('admin.webhooks.title')) end it 'fails to create with no events selected' do @@ -54,7 +54,7 @@ RSpec.describe 'Admin Webhooks' do expect { submit_form } .to_not change(Webhook, :count) expect(page) - .to have_content(/errors below/) + .to have_text(/errors below/) end def submit_form diff --git a/spec/system/auth/registrations_spec.rb b/spec/system/auth/registrations_spec.rb index 3a103667e6..04ad77f819 100644 --- a/spec/system/auth/registrations_spec.rb +++ b/spec/system/auth/registrations_spec.rb @@ -10,7 +10,7 @@ RSpec.describe 'Auth Registration' do visit new_user_registration_path expect(page) .to have_title(I18n.t('auth.register')) - .and have_content(rule.text) + .and have_text(rule.text) end end @@ -28,7 +28,7 @@ RSpec.describe 'Auth Registration' do expect { fill_in_and_submit_form } .to not_change(User, :count) expect(page) - .to have_content(/error below/) + .to have_text(/error below/) end end @@ -45,7 +45,7 @@ RSpec.describe 'Auth Registration' do expect(User.last) .to have_attributes(email: 'test@example.com', age_verified_at: be_present) expect(page) - .to have_content(I18n.t('auth.setup.title')) + .to have_text(I18n.t('auth.setup.title')) end end diff --git a/spec/system/auth/setup_spec.rb b/spec/system/auth/setup_spec.rb index 154f8cd5fa..1c3ef67294 100644 --- a/spec/system/auth/setup_spec.rb +++ b/spec/system/auth/setup_spec.rb @@ -12,7 +12,7 @@ RSpec.describe 'Auth Setup' do visit auth_setup_path expect(page) - .to have_content(I18n.t('auth.setup.title')) + .to have_text(I18n.t('auth.setup.title')) find('summary.lead').click fill_in 'user_email', with: 'new-email@example.host' @@ -20,7 +20,7 @@ RSpec.describe 'Auth Setup' do expect { submit_form } .to(change { user.reload.unconfirmed_email }) expect(page) - .to have_content(I18n.t('auth.setup.new_confirmation_instructions_sent')) + .to have_text(I18n.t('auth.setup.new_confirmation_instructions_sent')) end def submit_form diff --git a/spec/system/captcha_spec.rb b/spec/system/captcha_spec.rb index 89c480221b..d1efbf8309 100644 --- a/spec/system/captcha_spec.rb +++ b/spec/system/captcha_spec.rb @@ -31,7 +31,7 @@ RSpec.describe 'email confirmation flow when captcha is enabled' do # It presents a page with a link to the app callback expect(page) - .to have_content(I18n.t('auth.confirmations.registration_complete', domain: local_domain_uri.host)) + .to have_text(I18n.t('auth.confirmations.registration_complete', domain: local_domain_uri.host)) .and have_link(I18n.t('auth.confirmations.clicking_this_link'), href: client_app.confirmation_redirect_uri) end end diff --git a/spec/system/disputes/appeals_spec.rb b/spec/system/disputes/appeals_spec.rb index 0b601c4584..2003a580c3 100644 --- a/spec/system/disputes/appeals_spec.rb +++ b/spec/system/disputes/appeals_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'Dispute Appeals' do expect(emails) .to be_empty expect(page) - .to have_content(/can't be blank/) + .to have_text(/can't be blank/) # Valid with text fill_in 'appeal_text', with: 'It wasnt me this time!' @@ -31,7 +31,7 @@ RSpec.describe 'Dispute Appeals' do .to change(Appeal, :count).by(1) .and send_email(to: admin.email, subject: new_appeal_subject) expect(page) - .to have_content(I18n.t('disputes.strikes.appealed_msg')) + .to have_text(I18n.t('disputes.strikes.appealed_msg')) end def new_appeal_subject diff --git a/spec/system/disputes/strikes_spec.rb b/spec/system/disputes/strikes_spec.rb index d2b6b08c46..5d026a6164 100644 --- a/spec/system/disputes/strikes_spec.rb +++ b/spec/system/disputes/strikes_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Disputes Strikes' do find('.strike-entry').click expect(page) .to have_title(strike_page_title) - .and have_content(strike.text) + .and have_text(strike.text) end def strike_page_title diff --git a/spec/system/filters_spec.rb b/spec/system/filters_spec.rb index 652a1a3f23..a44da1d68f 100644 --- a/spec/system/filters_spec.rb +++ b/spec/system/filters_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'Filters' do visit filters_path expect(page) - .to have_content('Photography') + .to have_text('Photography') .and have_private_cache_control end end @@ -26,7 +26,7 @@ RSpec.describe 'Filters' do click_on I18n.t('filters.new.title') fill_in_filter_form - expect(page).to have_content(filter_title) + expect(page).to have_text(filter_title) end it 'Does not save with invalid values' do @@ -36,7 +36,7 @@ RSpec.describe 'Filters' do expect { click_on I18n.t('filters.new.save') } .to_not change(CustomFilter, :count) expect(page) - .to have_content("can't be blank") + .to have_text("can't be blank") end end @@ -60,7 +60,7 @@ RSpec.describe 'Filters' do .to change { keyword_one.reload.keyword }.to(/New value/) .and(change { keyword_two.reload.keyword }.to(/Wilderness/)) - expect(page).to have_content(new_title) + expect(page).to have_text(new_title) end it 'Does not save with invalid values' do @@ -72,7 +72,7 @@ RSpec.describe 'Filters' do expect { click_on submit_button } .to_not(change { custom_filter.reload.updated_at }) expect(page) - .to have_content("can't be blank") + .to have_text("can't be blank") end end @@ -82,12 +82,12 @@ RSpec.describe 'Filters' do it 'Deletes the filter' do navigate_to_filters - expect(page).to have_content filter_title + expect(page).to have_text filter_title expect do click_on I18n.t('filters.index.delete') end.to change(CustomFilter, :count).by(-1) - expect(page).to have_no_content(filter_title) + expect(page).to have_no_text(filter_title) end end @@ -95,7 +95,7 @@ RSpec.describe 'Filters' do visit settings_path click_on I18n.t('filters.index.title') - expect(page).to have_content I18n.t('filters.index.title') + expect(page).to have_text I18n.t('filters.index.title') end def fill_in_filter_form diff --git a/spec/system/invites_spec.rb b/spec/system/invites_spec.rb index 2b3cca8d41..231c19e886 100644 --- a/spec/system/invites_spec.rb +++ b/spec/system/invites_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Invites' do within css_id(invite) do expect(page) - .to have_content(invite.uses) + .to have_text(invite.uses) .and have_private_cache_control expect(copyable_field.value) .to eq(public_invite_url(invite_code: invite.code)) @@ -46,7 +46,7 @@ RSpec.describe 'Invites' do .to change { invite.reload.expired? }.to(true) within css_id(invite) do - expect(page).to have_content I18n.t('invites.expired') + expect(page).to have_text I18n.t('invites.expired') end end end diff --git a/spec/system/oauth_spec.rb b/spec/system/oauth_spec.rb index bba4b03ace..585e20ca5e 100644 --- a/spec/system/oauth_spec.rb +++ b/spec/system/oauth_spec.rb @@ -24,7 +24,7 @@ RSpec.describe 'Using OAuth from an external app' do subject # It presents the user with an authorization page - expect(page).to have_content(oauth_authorize_text) + expect(page).to have_text(oauth_authorize_text) # It grants the app access to the account expect { click_on oauth_authorize_text } @@ -38,7 +38,7 @@ RSpec.describe 'Using OAuth from an external app' do subject # It presents the user with an authorization page - expect(page).to have_content(oauth_deny_text) + expect(page).to have_text(oauth_deny_text) # It does not grant the app access to the account expect { click_on oauth_deny_text } @@ -108,7 +108,7 @@ RSpec.describe 'Using OAuth from an external app' do within '.form-container .flash-message' do expect(page) - .to have_content(doorkeeper_invalid_code_message) + .to have_text(doorkeeper_invalid_code_message) end end @@ -133,7 +133,7 @@ RSpec.describe 'Using OAuth from an external app' do subject # It presents the user with the 2FA setup page - expect(page).to have_content(I18n.t('two_factor_authentication.role_requirement', domain: local_domain_uri.host)) + expect(page).to have_text(I18n.t('two_factor_authentication.role_requirement', domain: local_domain_uri.host)) click_on I18n.t('otp_authentication.setup') # Fill in challenge form @@ -150,7 +150,7 @@ RSpec.describe 'Using OAuth from an external app' do click_on I18n.t('two_factor_authentication.resume_app_authorization') # It presents the user with an authorization page - expect(page).to have_content(oauth_authorize_text) + expect(page).to have_text(oauth_authorize_text) # It grants the app access to the account expect { click_on oauth_authorize_text } @@ -177,15 +177,15 @@ RSpec.describe 'Using OAuth from an external app' do visit "/oauth/authorize?#{params.to_query}" # It presents the user with a log-in page - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Failing to log-in presents the form again fill_in_auth_details(email, 'wrong password') - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Logging in redirects to an authorization page fill_in_auth_details(email, password) - expect(page).to have_content(oauth_authorize_text) + expect(page).to have_text(oauth_authorize_text) # It grants the app access to the account expect { click_on oauth_authorize_text } @@ -199,15 +199,15 @@ RSpec.describe 'Using OAuth from an external app' do visit "/oauth/authorize?#{params.to_query}" # It presents the user with a log-in page - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Failing to log-in presents the form again fill_in_auth_details(email, 'wrong password') - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Logging in redirects to an authorization page fill_in_auth_details(email, password) - expect(page).to have_content(oauth_authorize_text) + expect(page).to have_text(oauth_authorize_text) # It does not grant the app access to the account expect { click_on oauth_deny_text } @@ -224,23 +224,23 @@ RSpec.describe 'Using OAuth from an external app' do visit "/oauth/authorize?#{params.to_query}" # It presents the user with a log-in page - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Failing to log-in presents the form again fill_in_auth_details(email, 'wrong password') - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Logging in redirects to a two-factor authentication page fill_in_auth_details(email, password) - expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp')) + expect(page).to have_text(I18n.t('simple_form.hints.sessions.otp')) # Filling in an incorrect two-factor authentication code presents the form again fill_in_otp_details('wrong') - expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp')) + expect(page).to have_text(I18n.t('simple_form.hints.sessions.otp')) # Filling in the correct TOTP code redirects to an app authorization page fill_in_otp_details(user.current_otp) - expect(page).to have_content(oauth_authorize_text) + expect(page).to have_text(oauth_authorize_text) # It grants the app access to the account expect { click_on oauth_authorize_text } @@ -254,23 +254,23 @@ RSpec.describe 'Using OAuth from an external app' do visit "/oauth/authorize?#{params.to_query}" # It presents the user with a log-in page - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Failing to log-in presents the form again fill_in_auth_details(email, 'wrong password') - expect(page).to have_content(I18n.t('auth.login')) + expect(page).to have_text(I18n.t('auth.login')) # Logging in redirects to a two-factor authentication page fill_in_auth_details(email, password) - expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp')) + expect(page).to have_text(I18n.t('simple_form.hints.sessions.otp')) # Filling in an incorrect two-factor authentication code presents the form again fill_in_otp_details('wrong') - expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp')) + expect(page).to have_text(I18n.t('simple_form.hints.sessions.otp')) # Filling in the correct TOTP code redirects to an app authorization page fill_in_otp_details(user.current_otp) - expect(page).to have_content(oauth_authorize_text) + expect(page).to have_text(oauth_authorize_text) # It does not grant the app access to the account expect { click_on oauth_deny_text } diff --git a/spec/system/redirections_spec.rb b/spec/system/redirections_spec.rb index 6abde389db..5a90c64966 100644 --- a/spec/system/redirections_spec.rb +++ b/spec/system/redirections_spec.rb @@ -12,7 +12,7 @@ RSpec.describe 'redirection confirmations' do visit "/@#{account.pretty_acct}" expect(page) - .to have_content(redirect_title) # Redirect explanation + .to have_text(redirect_title) # Redirect explanation .and have_link(account.url, href: account.url) # Appropriate account link .and have_css('body', class: 'app-body') end @@ -23,7 +23,7 @@ RSpec.describe 'redirection confirmations' do visit "/@#{account.pretty_acct}/#{status.id}" expect(page) - .to have_content(redirect_title) # Redirect explanation + .to have_text(redirect_title) # Redirect explanation .and have_link(status.url, href: status.url) # Appropriate status link .and have_css('body', class: 'app-body') end diff --git a/spec/system/report_interface_spec.rb b/spec/system/report_interface_spec.rb index 3df6b3714b..93f4d3dee7 100644 --- a/spec/system/report_interface_spec.rb +++ b/spec/system/report_interface_spec.rb @@ -41,6 +41,6 @@ RSpec.describe 'report interface', :attachment_processing, :js, :streaming do click_on I18n.t('admin.reports.mark_as_resolved') end expect(page) - .to have_content(I18n.t('admin.reports.resolved_msg')) + .to have_text(I18n.t('admin.reports.resolved_msg')) end end diff --git a/spec/system/settings/aliases_spec.rb b/spec/system/settings/aliases_spec.rb index 96d9461503..13aa3e67f6 100644 --- a/spec/system/settings/aliases_spec.rb +++ b/spec/system/settings/aliases_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'Settings aliases page' do # View index page expect(page) - .to have_content(I18n.t('settings.aliases')) + .to have_text(I18n.t('settings.aliases')) .and have_private_cache_control end end @@ -31,7 +31,7 @@ RSpec.describe 'Settings aliases page' do expect { submit_form } .to change(AccountAlias, :count).by(1) expect(page) - .to have_content(I18n.t('aliases.created_msg')) + .to have_text(I18n.t('aliases.created_msg')) end end @@ -44,7 +44,7 @@ RSpec.describe 'Settings aliases page' do expect { submit_form } .to not_change(AccountAlias, :count) expect(page) - .to have_content(I18n.t('settings.aliases')) + .to have_text(I18n.t('settings.aliases')) end end @@ -66,8 +66,8 @@ RSpec.describe 'Settings aliases page' do .to change(AccountAlias, :count).by(-1) expect(page) - .to have_content(I18n.t('settings.aliases')) - .and have_content(I18n.t('aliases.deleted_msg')) + .to have_text(I18n.t('settings.aliases')) + .and have_text(I18n.t('aliases.deleted_msg')) expect { account_alias.reload } .to raise_error(ActiveRecord::RecordNotFound) end diff --git a/spec/system/settings/applications_spec.rb b/spec/system/settings/applications_spec.rb index 024a640355..e7ea1aedf7 100644 --- a/spec/system/settings/applications_spec.rb +++ b/spec/system/settings/applications_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Settings applications page' do visit settings_applications_path expect(page) - .to have_content(application.name) + .to have_text(application.name) .and have_private_cache_control end end @@ -23,7 +23,7 @@ RSpec.describe 'Settings applications page' do visit settings_application_path(application) expect(page) - .to have_content(application.name) + .to have_text(application.name) end end @@ -36,11 +36,11 @@ RSpec.describe 'Settings applications page' do expect { submit_form } .to change(Doorkeeper::Application, :count).by(1) expect(page) - .to have_content(I18n.t('doorkeeper.applications.index.title')) - .and have_content('My new app') - .and have_content('read') - .and have_content('write') - .and have_content('follow') + .to have_text(I18n.t('doorkeeper.applications.index.title')) + .and have_text('My new app') + .and have_text('read') + .and have_text('write') + .and have_text('follow') end it 'does not save with invalid form values' do @@ -49,7 +49,7 @@ RSpec.describe 'Settings applications page' do expect { submit_form } .to not_change(Doorkeeper::Application, :count) expect(page) - .to have_content("can't be blank") + .to have_text("can't be blank") end def fill_in_form @@ -80,7 +80,7 @@ RSpec.describe 'Settings applications page' do submit_form expect(page) - .to have_content('My new app name with a new value') + .to have_text('My new app name with a new value') .and have_checked_field('push', id: :doorkeeper_application_scopes_push) end @@ -92,7 +92,7 @@ RSpec.describe 'Settings applications page' do submit_form expect(page) - .to have_content("can't be blank") + .to have_text("can't be blank") end def submit_form @@ -117,7 +117,7 @@ RSpec.describe 'Settings applications page' do expect { destroy_application } .to change(Doorkeeper::Application, :count).by(-1) expect(page) - .to have_no_content(application.name) + .to have_no_text(application.name) expect(redis_pipeline_stub) .to have_received(:publish).with("timeline:access_token:#{access_token.id}", '{"event":"kill"}') end @@ -141,7 +141,7 @@ RSpec.describe 'Settings applications page' do expect { regenerate_token } .to(change { user_application_token.first.token }) expect(page) - .to have_content(I18n.t('applications.token_regenerated')) + .to have_text(I18n.t('applications.token_regenerated')) end def user_application_token diff --git a/spec/system/settings/deletes_spec.rb b/spec/system/settings/deletes_spec.rb index 91f7104252..2a18a27694 100644 --- a/spec/system/settings/deletes_spec.rb +++ b/spec/system/settings/deletes_spec.rb @@ -18,13 +18,13 @@ RSpec.describe 'Settings Deletes' do fill_in 'form_delete_confirmation_password', with: 'wrongvalue' click_on I18n.t('deletes.proceed') expect(page) - .to have_content(I18n.t('deletes.challenge_not_passed')) + .to have_text(I18n.t('deletes.challenge_not_passed')) # Correct confirmation value fill_in 'form_delete_confirmation_password', with: user.password click_on I18n.t('deletes.proceed') expect(page) - .to have_content(I18n.t('deletes.success_msg')) + .to have_text(I18n.t('deletes.success_msg')) expect(page) .to have_title(I18n.t('auth.login')) expect(User.find_by(id: user.id)) diff --git a/spec/system/settings/exports_spec.rb b/spec/system/settings/exports_spec.rb index 2cc2961a0b..392b5a50ab 100644 --- a/spec/system/settings/exports_spec.rb +++ b/spec/system/settings/exports_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Export page' do visit settings_export_path expect(page) - .to have_content(takeout_summary) + .to have_text(takeout_summary) .and have_private_cache_control end end @@ -26,7 +26,7 @@ RSpec.describe 'Export page' do expect { request_archive } .to change(BackupWorker.jobs, :size).by(1) expect(page) - .to have_content(takeout_summary) + .to have_text(takeout_summary) end def request_archive diff --git a/spec/system/settings/login_activities_spec.rb b/spec/system/settings/login_activities_spec.rb index ff89c3f37e..4561c80057 100644 --- a/spec/system/settings/login_activities_spec.rb +++ b/spec/system/settings/login_activities_spec.rb @@ -16,9 +16,9 @@ RSpec.describe 'Login activities page' do click_on I18n.t('sessions.view_authentication_history') expect(page) - .to have_content(browser_description) - .and have_content(login_activity.authentication_method) - .and have_content(login_activity.ip) + .to have_text(browser_description) + .and have_text(login_activity.authentication_method) + .and have_text(login_activity.ip) .and have_private_cache_control end diff --git a/spec/system/settings/migration/redirects_spec.rb b/spec/system/settings/migration/redirects_spec.rb index 11882c571d..fa53a42796 100644 --- a/spec/system/settings/migration/redirects_spec.rb +++ b/spec/system/settings/migration/redirects_spec.rb @@ -29,7 +29,7 @@ RSpec.describe 'Settings Migration Redirects' do expect { click_on I18n.t('migrations.cancel') } .to(change { user.reload.account.moved_to_account_id }.to(nil)) expect(page) - .to have_content(I18n.t('migrations.cancelled_msg')) + .to have_text(I18n.t('migrations.cancelled_msg')) end context 'when user has blank encrypted password' do diff --git a/spec/system/settings/migrations_spec.rb b/spec/system/settings/migrations_spec.rb index d95636a609..4b94918415 100644 --- a/spec/system/settings/migrations_spec.rb +++ b/spec/system/settings/migrations_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'Settings Migrations' do visit settings_migration_path expect(page) - .to have_content(I18n.t('settings.migrate')) + .to have_text(I18n.t('settings.migrate')) end end @@ -26,8 +26,8 @@ RSpec.describe 'Settings Migrations' do visit settings_migration_path expect(page) - .to have_content(I18n.t('settings.migrate')) - .and have_content(moved_to_account.pretty_acct) + .to have_text(I18n.t('settings.migrate')) + .and have_text(moved_to_account.pretty_acct) end end end @@ -48,7 +48,7 @@ RSpec.describe 'Settings Migrations' do expect { fill_in_and_submit } .to(change { user.account.reload.moved_to_account_id }.to(acct.id)) expect(page) - .to have_content(I18n.t('settings.migrate')) + .to have_text(I18n.t('settings.migrate')) end end @@ -61,7 +61,7 @@ RSpec.describe 'Settings Migrations' do expect { fill_in_and_submit_via_username("@#{user.account.username}") } .to(change { user.account.reload.moved_to_account_id }.to(acct.id)) expect(page) - .to have_content(I18n.t('settings.migrate')) + .to have_text(I18n.t('settings.migrate')) end end end @@ -75,7 +75,7 @@ RSpec.describe 'Settings Migrations' do expect { fill_in_and_submit } .to_not(change { user.account.reload.moved_to_account_id }.from(nil)) expect(page) - .to have_content(I18n.t('settings.migrate')) + .to have_text(I18n.t('settings.migrate')) end end @@ -88,7 +88,7 @@ RSpec.describe 'Settings Migrations' do expect { fill_in_and_submit } .to_not(change { user.account.reload.moved_to_account_id }.from(nil)) expect(page) - .to have_content(I18n.t('settings.migrate')) + .to have_text(I18n.t('settings.migrate')) end end diff --git a/spec/system/settings/privacy_spec.rb b/spec/system/settings/privacy_spec.rb index 5e1498613e..e3e2165487 100644 --- a/spec/system/settings/privacy_spec.rb +++ b/spec/system/settings/privacy_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'Settings Privacy' do # View settings page visit settings_privacy_path expect(page) - .to have_content(I18n.t('privacy.title')) + .to have_text(I18n.t('privacy.title')) .and have_private_cache_control # Fill out form and submit @@ -24,8 +24,8 @@ RSpec.describe 'Settings Privacy' do expect { click_on submit_button } .to change { user.account.reload.discoverable }.to(true) expect(page) - .to have_content(I18n.t('privacy.title')) - .and have_content(success_message) + .to have_text(I18n.t('privacy.title')) + .and have_text(success_message) expect(ActivityPub::UpdateDistributionWorker) .to have_enqueued_sidekiq_job(user.account.id) end @@ -40,7 +40,7 @@ RSpec.describe 'Settings Privacy' do # View settings page visit settings_privacy_path expect(page) - .to have_content(I18n.t('privacy.title')) + .to have_text(I18n.t('privacy.title')) .and have_private_cache_control # Fill out form and submit @@ -49,7 +49,7 @@ RSpec.describe 'Settings Privacy' do expect { click_on submit_button } .to_not(change { user.account.reload.discoverable }) expect(page) - .to have_content(I18n.t('privacy.title')) + .to have_text(I18n.t('privacy.title')) expect(ActivityPub::UpdateDistributionWorker) .to_not have_enqueued_sidekiq_job(anything) end diff --git a/spec/system/settings/sessions_spec.rb b/spec/system/settings/sessions_spec.rb index ffc7a64185..9ce35b0fa9 100644 --- a/spec/system/settings/sessions_spec.rb +++ b/spec/system/settings/sessions_spec.rb @@ -19,7 +19,7 @@ RSpec.describe 'Settings Sessions' do expect { session_activation.reload } .to raise_error(ActiveRecord::RecordNotFound) expect(page) - .to have_content(I18n.t('sessions.revoke_success')) + .to have_text(I18n.t('sessions.revoke_success')) end end end diff --git a/spec/system/settings/two_factor_authentication/recovery_codes_spec.rb b/spec/system/settings/two_factor_authentication/recovery_codes_spec.rb index ba8491429c..59ea57f7b3 100644 --- a/spec/system/settings/two_factor_authentication/recovery_codes_spec.rb +++ b/spec/system/settings/two_factor_authentication/recovery_codes_spec.rb @@ -24,10 +24,10 @@ RSpec.describe 'Settings TwoFactorAuthentication RecoveryCodes' do .to(change { user.reload.otp_backup_codes }) expect(page) - .to have_content(I18n.t('two_factor_authentication.recovery_codes_regenerated')) + .to have_text(I18n.t('two_factor_authentication.recovery_codes_regenerated')) .and have_title(I18n.t('settings.two_factor_authentication')) .and have_css('ol.recovery-codes') - .and have_content(backup_code) + .and have_text(backup_code) end def stub_code_generator diff --git a/spec/system/settings/two_factor_authentication_methods_spec.rb b/spec/system/settings/two_factor_authentication_methods_spec.rb index 867c39e376..2eef78257f 100644 --- a/spec/system/settings/two_factor_authentication_methods_spec.rb +++ b/spec/system/settings/two_factor_authentication_methods_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'Settings TwoFactorAuthenticationMethods' do it 'disables 2FA with challenge confirmation', :inline_jobs do visit settings_two_factor_authentication_methods_path expect(page) - .to have_content(I18n.t('settings.two_factor_authentication')) + .to have_text(I18n.t('settings.two_factor_authentication')) .and have_private_cache_control # Attempt to disable @@ -29,7 +29,7 @@ RSpec.describe 'Settings TwoFactorAuthenticationMethods' do .and send_email(to: user.email, subject: I18n.t('devise.mailer.two_factor_disabled.subject')) expect(page) - .to have_content(I18n.t('two_factor_authentication.disabled_success')) + .to have_text(I18n.t('two_factor_authentication.disabled_success')) end end end diff --git a/spec/system/settings/verifications_spec.rb b/spec/system/settings/verifications_spec.rb index 87220057ed..089776e5de 100644 --- a/spec/system/settings/verifications_spec.rb +++ b/spec/system/settings/verifications_spec.rb @@ -12,7 +12,7 @@ RSpec.describe 'Settings verification page' do visit settings_verification_path expect(page) - .to have_content(verification_summary) + .to have_text(verification_summary) .and have_private_cache_control fill_in attribution_field, with: " example.com\n\n https://example.net" @@ -20,9 +20,9 @@ RSpec.describe 'Settings verification page' do expect { click_on submit_button } .to(change { user.account.reload.attribution_domains }.to(['example.com', 'example.net'])) expect(page) - .to have_content(success_message) + .to have_text(success_message) expect(find_field(attribution_field).value) - .to have_content("example.com\nexample.net") + .to have_text("example.com\nexample.net") end it 'rejects invalid attribution domains' do @@ -33,9 +33,9 @@ RSpec.describe 'Settings verification page' do expect { click_on submit_button } .to_not(change { user.account.reload.attribution_domains }) expect(page) - .to have_content(I18n.t('activerecord.errors.messages.invalid_domain_on_line', value: 'invalid_com')) + .to have_text(I18n.t('activerecord.errors.messages.invalid_domain_on_line', value: 'invalid_com')) expect(find_field(attribution_field).value) - .to have_content("example.com\ninvalid_com") + .to have_text("example.com\ninvalid_com") end end diff --git a/spec/system/statuses_cleanup_spec.rb b/spec/system/statuses_cleanup_spec.rb index 524f710af7..0f490fda56 100644 --- a/spec/system/statuses_cleanup_spec.rb +++ b/spec/system/statuses_cleanup_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'Automated post deletion settings' do expect { submit_form } .to change { account.reload.statuses_cleanup_policy.keep_pinned? }.to(false) expect(page) - .to have_content(I18n.t('settings.statuses_cleanup')) + .to have_text(I18n.t('settings.statuses_cleanup')) end def submit_form