Skip to content

Commit

Permalink
Fix Capybara/ClickLinkOrButtonStyle violations for links
Browse files Browse the repository at this point in the history
  • Loading branch information
floehopper committed Apr 27, 2024
1 parent e463d25 commit 72ebf44
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions test/system/artists_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/system/collection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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*'
Expand Down
8 changes: 4 additions & 4 deletions test/system/creating_an_album_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ 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

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

Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/system/creating_an_artist_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions test/system/identity/emails_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: '[email protected]'
fill_in 'Current password', with: 'Secret1*3*5*'
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/system/identity/password_resets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions test/system/passwords_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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*'
Expand Down
2 changes: 1 addition & 1 deletion test/system/payout_details_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions test/system/publishing_an_album_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/system/signing_up_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: '[email protected]'
fill_in 'Password', with: 'Secret1*3*5*'
fill_in 'Password confirmation', with: 'Secret1*3*5*'
Expand Down

0 comments on commit 72ebf44

Please sign in to comment.