From d2b4c6be93d972ff6678c2a6e6a64e9a2f430658 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Apr 2024 10:58:01 +0000 Subject: [PATCH 1/4] Bump rubocop-capybara from 2.19.0 to 2.20.0 Bumps [rubocop-capybara](https://github.com/rubocop/rubocop-capybara) from 2.19.0 to 2.20.0. - [Release notes](https://github.com/rubocop/rubocop-capybara/releases) - [Changelog](https://github.com/rubocop/rubocop-capybara/blob/main/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-capybara/compare/v2.19.0...v2.20.0) --- updated-dependencies: - dependency-name: rubocop-capybara dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 38f7bb14..aa0dd300 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,7 +170,7 @@ GEM actionview (>= 5.0.0) activesupport (>= 5.0.0) jmespath (1.6.2) - json (2.7.1) + json (2.7.2) language_server-protocol (3.17.0.3) launchy (2.5.2) addressable (~> 2.8) @@ -215,7 +215,7 @@ GEM nokogiri (1.16.4-x86_64-linux) racc (~> 1.4) parallel (1.24.0) - parser (3.3.0.2) + parser (3.3.1.0) ast (~> 2.4.1) racc pg (1.5.4) @@ -295,20 +295,20 @@ GEM rollbar (3.5.1) rss (0.3.0) rexml - rubocop (1.59.0) + rubocop (1.63.3) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.19.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-capybara (2.20.0) rubocop (~> 1.41) rubocop-factory_bot (2.25.1) rubocop (~> 1.41) From 23bfa036f7b65bcd39dab05b8243a3c45678c020 Mon Sep 17 00:00:00 2001 From: James Mead Date: Sat, 27 Apr 2024 12:04:55 +0100 Subject: [PATCH 2/4] Auto-correct Layout/EmptyLineAfterMagicComment violations --- config/initializers/content_security_policy.rb | 1 + config/initializers/inflections.rb | 1 + config/initializers/new_framework_defaults_7_1.rb | 1 + config/initializers/permissions_policy.rb | 1 + 4 files changed, 4 insertions(+) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index af395e46..35ab3fd6 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide content security policy. diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 6c78420e..9e049dcc 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/new_framework_defaults_7_1.rb b/config/initializers/new_framework_defaults_7_1.rb index 974cc2aa..707271fd 100644 --- a/config/initializers/new_framework_defaults_7_1.rb +++ b/config/initializers/new_framework_defaults_7_1.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # # This file eases your Rails 7.1 framework defaults upgrade. diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb index b635b527..e8d0b2ae 100644 --- a/config/initializers/permissions_policy.rb +++ b/config/initializers/permissions_policy.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide HTTP permissions policy. For further From c86d516c0c28f57f9cd7dddd973439807a83ca3c Mon Sep 17 00:00:00 2001 From: James Mead Date: Sat, 27 Apr 2024 12:06:14 +0100 Subject: [PATCH 3/4] Fix Capybara/ClickLinkOrButtonStyle violations for buttons --- test/application_system_test_case.rb | 6 +++--- test/system/artists_test.rb | 4 ++-- test/system/buying_an_album_test.rb | 4 ++-- test/system/collection_test.rb | 14 +++++++------- test/system/creating_an_album_test.rb | 4 ++-- test/system/creating_an_artist_test.rb | 4 ++-- test/system/identity/emails_test.rb | 8 ++++---- test/system/identity/password_resets_test.rb | 4 ++-- test/system/passwords_test.rb | 4 ++-- test/system/payout_details_test.rb | 2 +- test/system/publishing_an_album_test.rb | 4 ++-- test/system/sessions_test.rb | 6 +++--- test/system/signing_up_test.rb | 2 +- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index c8c7e3c7..24bbf61f 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -17,13 +17,13 @@ def log_in_as(user) visit log_in_url fill_in :email, with: user.email fill_in :password, with: 'Secret1*3*5*' - click_button 'Log in' + click_on 'Log in' assert_current_path root_url user end def sign_out - click_button 'avatar' - click_button 'Log out' + click_on 'avatar' + click_on 'Log out' end end diff --git a/test/system/artists_test.rb b/test/system/artists_test.rb index 79268b17..5b07683b 100644 --- a/test/system/artists_test.rb +++ b/test/system/artists_test.rb @@ -17,7 +17,7 @@ class ArtistsTest < ApplicationSystemTestCase fill_in 'Location', with: @artist.location fill_in 'Description', with: @artist.description attach_file 'Profile picture', Rails.root.join('test/fixtures/files/cover.png') - click_button 'Save' + click_on 'Save' assert_selector 'h2', text: @artist.name end @@ -30,7 +30,7 @@ class ArtistsTest < ApplicationSystemTestCase assert_text @artist.name click_link 'Edit artist' fill_in 'Name', with: 'New Artist Name' - click_button 'Save' + click_on 'Save' assert_text 'New Artist Name' end end diff --git a/test/system/buying_an_album_test.rb b/test/system/buying_an_album_test.rb index 73bd1d14..d38aecd7 100644 --- a/test/system/buying_an_album_test.rb +++ b/test/system/buying_an_album_test.rb @@ -13,9 +13,9 @@ class BuyingAnAlbumTest < ApplicationSystemTestCase test 'purchasing an album' do visit artist_album_url(@album.artist, @album) - click_button 'Buy' + click_on 'Buy' fill_in 'Price', with: @album.price - click_button 'Checkout' + click_on 'Checkout' # Fake the Stripe checkout redirect to the "success_url" visit purchase_url(Purchase.last) diff --git a/test/system/collection_test.rb b/test/system/collection_test.rb index 65db49c7..f4c86e30 100644 --- a/test/system/collection_test.rb +++ b/test/system/collection_test.rb @@ -12,9 +12,9 @@ class CollectionTest < ApplicationSystemTestCase test 'when a logged in user purchases an album it appears in their collection' do log_in_as(@user) visit artist_album_url(@album.artist, @album) - click_button 'Buy' + click_on 'Buy' fill_in 'Price', with: @album.price - click_button 'Checkout' + click_on 'Checkout' fake_stripe_webhook_event_completed(@user) visit collection_url assert_text @album.title @@ -22,9 +22,9 @@ class CollectionTest < ApplicationSystemTestCase test 'when a logged out user purchases an album it appears in their collection' do visit artist_album_url(@album.artist, @album) - click_button 'Buy' + click_on 'Buy' fill_in 'Price', with: @album.price - click_button 'Checkout' + click_on 'Checkout' fake_stripe_webhook_event_completed(@user) log_in_as(@user) @@ -36,9 +36,9 @@ class CollectionTest < ApplicationSystemTestCase user = build(:user, email: 'someone@example.com') visit artist_album_url(@album.artist, @album) - click_button 'Buy' + click_on 'Buy' fill_in 'Price', with: @album.price - click_button 'Checkout' + click_on 'Checkout' fake_stripe_webhook_event_completed(user) visit root_url @@ -47,7 +47,7 @@ class CollectionTest < ApplicationSystemTestCase fill_in 'Password', with: 'Secret1*3*5*' fill_in 'Password confirmation', with: 'Secret1*3*5*' perform_enqueued_jobs do - click_button 'Sign up' + click_on 'Sign up' end visit verify_email_url assert_text 'Thank you for verifying your email address' diff --git a/test/system/creating_an_album_test.rb b/test/system/creating_an_album_test.rb index 862d43d8..f88f4bba 100644 --- a/test/system/creating_an_album_test.rb +++ b/test/system/creating_an_album_test.rb @@ -22,7 +22,7 @@ class CreatingAnAlbumTest < ApplicationSystemTestCase attach_file 'File', Rails.root.join('test/fixtures/files/track.wav') end - click_button 'Save' + click_on 'Save' assert_text "A Hard Day's Night (unpublished)" click_link "A Hard Day's Night (unpublished)" @@ -36,7 +36,7 @@ class CreatingAnAlbumTest < ApplicationSystemTestCase assert_text album.title click_link 'Edit album' fill_in 'Title', with: 'New Title' - click_button 'Save' + click_on 'Save' assert_text 'New Title' end end diff --git a/test/system/creating_an_artist_test.rb b/test/system/creating_an_artist_test.rb index a6148755..21723560 100644 --- a/test/system/creating_an_artist_test.rb +++ b/test/system/creating_an_artist_test.rb @@ -11,14 +11,14 @@ class CreatingAnArtistTest < ApplicationSystemTestCase test 'creating an artist' do visit root_url - click_button 'avatar' + click_on 'avatar' click_link 'Add artist' fill_in 'Name', with: 'The Beatles' fill_in 'Location', with: 'Liverpool' fill_in 'Description', with: 'A popular beat combo' attach_file 'Profile picture', Rails.root.join('test/fixtures/files/cover.png') - click_button 'Save' + click_on 'Save' assert_text 'The Beatles' assert_text 'Liverpool' diff --git a/test/system/identity/emails_test.rb b/test/system/identity/emails_test.rb index 94e38358..1f05dc3c 100644 --- a/test/system/identity/emails_test.rb +++ b/test/system/identity/emails_test.rb @@ -9,13 +9,13 @@ class EmailsTest < ApplicationSystemTestCase end test 'updating the email' do - click_button 'avatar' + click_on 'avatar' click_link 'My account' click_link 'Change email address' fill_in 'New email', with: 'new_email@hey.com' fill_in 'Current password', with: 'Secret1*3*5*' - click_button 'Save changes' + click_on 'Save changes' assert_text 'Your email has been changed' end @@ -23,10 +23,10 @@ class EmailsTest < ApplicationSystemTestCase test 'sending a verification email' do @user.update! verified: false - click_button 'avatar' + click_on 'avatar' click_link 'My account' click_link 'Change email address' - click_button 'Re-send verification email' + click_on 'Re-send verification email' assert_text 'We sent a verification email to your email address' end diff --git a/test/system/identity/password_resets_test.rb b/test/system/identity/password_resets_test.rb index a15d59af..ee8ae91f 100644 --- a/test/system/identity/password_resets_test.rb +++ b/test/system/identity/password_resets_test.rb @@ -14,7 +14,7 @@ class PasswordResetsTest < ApplicationSystemTestCase click_link 'Forgot your password?' fill_in 'Email', with: @user.email - click_button 'Send password reset email' + click_on 'Send password reset email' assert_text 'Check your email for reset instructions' end @@ -24,7 +24,7 @@ class PasswordResetsTest < ApplicationSystemTestCase fill_in 'New password', with: 'Secret6*4*2*' fill_in 'Confirm new password', with: 'Secret6*4*2*' - click_button 'Save changes' + click_on 'Save changes' assert_text 'Your password was reset successfully. Please sign in' end diff --git a/test/system/passwords_test.rb b/test/system/passwords_test.rb index f09be4e6..42c11d57 100644 --- a/test/system/passwords_test.rb +++ b/test/system/passwords_test.rb @@ -8,14 +8,14 @@ class PasswordsTest < ApplicationSystemTestCase end test 'updating the password' do - click_button 'avatar' + click_on 'avatar' click_link 'My account' click_link 'Change password' fill_in 'Current password', with: 'Secret1*3*5*' fill_in 'New password', with: 'Secret6*4*2*' fill_in 'Confirm new password', with: 'Secret6*4*2*' - click_button 'Save changes' + click_on 'Save changes' assert_text 'Your password has been changed' end diff --git a/test/system/payout_details_test.rb b/test/system/payout_details_test.rb index dcbe4274..24dbfea4 100644 --- a/test/system/payout_details_test.rb +++ b/test/system/payout_details_test.rb @@ -13,7 +13,7 @@ class PayoutDetailsTest < ApplicationSystemTestCase click_link 'Add payout details' fill_in 'Name', with: 'John Lennon' select '🇬🇧 United Kingdom (GBP)', from: 'Country / Region' - click_button 'Save' + click_on 'Save' assert_equal 'John Lennon', @user.payout_detail.name assert_equal 'united_kingdom', @user.payout_detail.country diff --git a/test/system/publishing_an_album_test.rb b/test/system/publishing_an_album_test.rb index aa296f55..a2147c70 100644 --- a/test/system/publishing_an_album_test.rb +++ b/test/system/publishing_an_album_test.rb @@ -14,7 +14,7 @@ class PublishingAnAlbumTest < ApplicationSystemTestCase # Artist requests publication visit artist_url(@album.artist) click_link "#{@album.title} (unpublished)" - click_button 'Publish' + click_on 'Publish' assert_text "Thank you! We'll email you when your album is published." sign_out @@ -22,7 +22,7 @@ class PublishingAnAlbumTest < ApplicationSystemTestCase admin = create(:user, admin: true, email: 'admin@example.com') log_in_as(admin) visit link_in_publish_request_email - click_button 'Publish' + click_on 'Publish' sign_out # Listener visits published album page diff --git a/test/system/sessions_test.rb b/test/system/sessions_test.rb index e5e4eb98..2cb25184 100644 --- a/test/system/sessions_test.rb +++ b/test/system/sessions_test.rb @@ -11,7 +11,7 @@ class SessionsTest < ApplicationSystemTestCase visit log_in_url fill_in 'Email', with: @user.email fill_in 'Password', with: 'Secret1*3*5*' - click_button 'Log in' + click_on 'Log in' assert_text 'Logged in successfully' end @@ -19,8 +19,8 @@ class SessionsTest < ApplicationSystemTestCase test 'logging out' do log_in_as @user - click_button 'avatar' - click_button 'Log out' + click_on 'avatar' + click_on 'Log out' assert_text 'That session has been logged out' end end diff --git a/test/system/signing_up_test.rb b/test/system/signing_up_test.rb index e3c7d546..9b7cfbf7 100644 --- a/test/system/signing_up_test.rb +++ b/test/system/signing_up_test.rb @@ -10,7 +10,7 @@ class SigningUpTest < ApplicationSystemTestCase fill_in 'Password', with: 'Secret1*3*5*' fill_in 'Password confirmation', with: 'Secret1*3*5*' perform_enqueued_jobs do - click_button 'Sign up' + click_on 'Sign up' end assert_text 'Welcome! You have signed up successfully' From b976215c378c48362ebfbdde9f36a8744fb29b2b Mon Sep 17 00:00:00 2001 From: James Mead Date: Sat, 27 Apr 2024 12:06:14 +0100 Subject: [PATCH 4/4] Fix Capybara/ClickLinkOrButtonStyle violations for links --- test/system/artists_test.rb | 4 ++-- test/system/collection_test.rb | 2 +- test/system/creating_an_album_test.rb | 8 ++++---- test/system/creating_an_artist_test.rb | 2 +- test/system/identity/emails_test.rb | 8 ++++---- test/system/identity/password_resets_test.rb | 2 +- test/system/passwords_test.rb | 4 ++-- test/system/payout_details_test.rb | 2 +- test/system/publishing_an_album_test.rb | 4 ++-- test/system/signing_up_test.rb | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/system/artists_test.rb b/test/system/artists_test.rb index 5b07683b..f985ce6d 100644 --- a/test/system/artists_test.rb +++ b/test/system/artists_test.rb @@ -12,7 +12,7 @@ class ArtistsTest < ApplicationSystemTestCase log_in_as(admin) visit artists_url - click_link 'New artist' + click_on 'New artist' fill_in 'Name', with: @artist.name fill_in 'Location', with: @artist.location fill_in 'Description', with: @artist.description @@ -28,7 +28,7 @@ class ArtistsTest < ApplicationSystemTestCase visit artist_url(@artist) assert_text @artist.name - click_link 'Edit artist' + click_on 'Edit artist' fill_in 'Name', with: 'New Artist Name' click_on 'Save' assert_text 'New Artist Name' diff --git a/test/system/collection_test.rb b/test/system/collection_test.rb index f4c86e30..9049429e 100644 --- a/test/system/collection_test.rb +++ b/test/system/collection_test.rb @@ -42,7 +42,7 @@ class CollectionTest < ApplicationSystemTestCase fake_stripe_webhook_event_completed(user) visit root_url - click_link 'sign up' + click_on 'sign up' fill_in 'Email', with: user.email fill_in 'Password', with: 'Secret1*3*5*' fill_in 'Password confirmation', with: 'Secret1*3*5*' diff --git a/test/system/creating_an_album_test.rb b/test/system/creating_an_album_test.rb index f88f4bba..d1bd89ea 100644 --- a/test/system/creating_an_album_test.rb +++ b/test/system/creating_an_album_test.rb @@ -12,12 +12,12 @@ class CreatingAnAlbumTest < ApplicationSystemTestCase test 'creating an album' do visit artist_url(@artist) - click_link 'Add album' + click_on 'Add album' fill_in 'Title', with: "A Hard Day's Night" attach_file 'Cover', Rails.root.join('test/fixtures/files/cover.png') within('#tracks') do - click_link 'Add track' + click_on 'Add track' fill_in 'Title', with: 'And I Love Her' attach_file 'File', Rails.root.join('test/fixtures/files/track.wav') end @@ -25,7 +25,7 @@ class CreatingAnAlbumTest < ApplicationSystemTestCase click_on 'Save' assert_text "A Hard Day's Night (unpublished)" - click_link "A Hard Day's Night (unpublished)" + click_on "A Hard Day's Night (unpublished)" assert_text '1. And I Love Her' end @@ -34,7 +34,7 @@ class CreatingAnAlbumTest < ApplicationSystemTestCase visit artist_album_url(@artist, album) assert_text album.title - click_link 'Edit album' + click_on 'Edit album' fill_in 'Title', with: 'New Title' click_on 'Save' assert_text 'New Title' diff --git a/test/system/creating_an_artist_test.rb b/test/system/creating_an_artist_test.rb index 21723560..1c904c5f 100644 --- a/test/system/creating_an_artist_test.rb +++ b/test/system/creating_an_artist_test.rb @@ -12,7 +12,7 @@ class CreatingAnArtistTest < ApplicationSystemTestCase test 'creating an artist' do visit root_url click_on 'avatar' - click_link 'Add artist' + click_on 'Add artist' fill_in 'Name', with: 'The Beatles' fill_in 'Location', with: 'Liverpool' fill_in 'Description', with: 'A popular beat combo' diff --git a/test/system/identity/emails_test.rb b/test/system/identity/emails_test.rb index 1f05dc3c..0d1c3073 100644 --- a/test/system/identity/emails_test.rb +++ b/test/system/identity/emails_test.rb @@ -10,8 +10,8 @@ class EmailsTest < ApplicationSystemTestCase test 'updating the email' do click_on 'avatar' - click_link 'My account' - click_link 'Change email address' + click_on 'My account' + click_on 'Change email address' fill_in 'New email', with: 'new_email@hey.com' fill_in 'Current password', with: 'Secret1*3*5*' @@ -24,8 +24,8 @@ class EmailsTest < ApplicationSystemTestCase @user.update! verified: false click_on 'avatar' - click_link 'My account' - click_link 'Change email address' + click_on 'My account' + click_on 'Change email address' click_on 'Re-send verification email' assert_text 'We sent a verification email to your email address' diff --git a/test/system/identity/password_resets_test.rb b/test/system/identity/password_resets_test.rb index ee8ae91f..fe35be10 100644 --- a/test/system/identity/password_resets_test.rb +++ b/test/system/identity/password_resets_test.rb @@ -11,7 +11,7 @@ class PasswordResetsTest < ApplicationSystemTestCase test 'sending a password reset email' do visit log_in_url - click_link 'Forgot your password?' + click_on 'Forgot your password?' fill_in 'Email', with: @user.email click_on 'Send password reset email' diff --git a/test/system/passwords_test.rb b/test/system/passwords_test.rb index 42c11d57..41608de0 100644 --- a/test/system/passwords_test.rb +++ b/test/system/passwords_test.rb @@ -9,8 +9,8 @@ class PasswordsTest < ApplicationSystemTestCase test 'updating the password' do click_on 'avatar' - click_link 'My account' - click_link 'Change password' + click_on 'My account' + click_on 'Change password' fill_in 'Current password', with: 'Secret1*3*5*' fill_in 'New password', with: 'Secret6*4*2*' diff --git a/test/system/payout_details_test.rb b/test/system/payout_details_test.rb index 24dbfea4..9d27b9bc 100644 --- a/test/system/payout_details_test.rb +++ b/test/system/payout_details_test.rb @@ -10,7 +10,7 @@ class PayoutDetailsTest < ApplicationSystemTestCase test 'adding payout details' do visit account_url - click_link 'Add payout details' + click_on 'Add payout details' fill_in 'Name', with: 'John Lennon' select '🇬🇧 United Kingdom (GBP)', from: 'Country / Region' click_on 'Save' diff --git a/test/system/publishing_an_album_test.rb b/test/system/publishing_an_album_test.rb index a2147c70..2d97e0a3 100644 --- a/test/system/publishing_an_album_test.rb +++ b/test/system/publishing_an_album_test.rb @@ -13,7 +13,7 @@ class PublishingAnAlbumTest < ApplicationSystemTestCase test 'publishing an album' do # Artist requests publication visit artist_url(@album.artist) - click_link "#{@album.title} (unpublished)" + click_on "#{@album.title} (unpublished)" click_on 'Publish' assert_text "Thank you! We'll email you when your album is published." sign_out @@ -27,7 +27,7 @@ class PublishingAnAlbumTest < ApplicationSystemTestCase # Listener visits published album page visit artist_url(@album.artist) - click_link @album.title + click_on @album.title end private diff --git a/test/system/signing_up_test.rb b/test/system/signing_up_test.rb index 9b7cfbf7..3ac0832f 100644 --- a/test/system/signing_up_test.rb +++ b/test/system/signing_up_test.rb @@ -5,7 +5,7 @@ class SigningUpTest < ApplicationSystemTestCase test 'signing up' do visit root_url - click_link 'sign up' + click_on 'sign up' fill_in 'Email', with: 'user@example.com' fill_in 'Password', with: 'Secret1*3*5*' fill_in 'Password confirmation', with: 'Secret1*3*5*'