Skip to content

Commit

Permalink
Update rubocop and rubocop-capybara
Browse files Browse the repository at this point in the history
I've fixed exceptions from the new cops.
  • Loading branch information
chrislo committed Oct 13, 2023
1 parent 9f3d463 commit 4ce9818
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ GEM
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pg (1.5.4)
Expand Down Expand Up @@ -253,16 +253,16 @@ GEM
redis-client (>= 0.9.0)
redis-client (0.17.0)
connection_pool
regexp_parser (2.8.1)
regexp_parser (2.8.2)
reline (0.3.7)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.56.4)
rubocop (1.57.1)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
Expand All @@ -271,7 +271,7 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.23.1)
rubocop (~> 1.33)
Expand Down
2 changes: 1 addition & 1 deletion test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def sign_in_as(user)
visit sign_in_url
fill_in :email, with: user.email
fill_in :password, with: 'Secret1*3*5*'
click_on 'Sign in'
click_button 'Sign in'
assert_current_path home_url
user
end
Expand Down
4 changes: 2 additions & 2 deletions test/system/artists_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class ArtistsTest < ApplicationSystemTestCase

test 'adding a new artist' do
visit artists_url
click_on 'New artist'
click_link 'New artist'
fill_in 'Name', with: @artist.name
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_on 'Save'
click_button 'Save'
assert_selector 'h2', text: @artist.name
end
end
4 changes: 2 additions & 2 deletions test/system/buying_an_album_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class BuyingAnAlbumTest < ApplicationSystemTestCase

test 'viewing the album' do
visit artists_url
click_on @album.artist.name
click_on @album.title
click_link @album.artist.name
click_link @album.title

assert_selector 'h1', text: @album.title
assert_selector 'h2', text: @album.artist.name
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 @@ -9,20 +9,20 @@ class EmailsTest < ApplicationSystemTestCase
end

test 'updating the email' do
click_on 'Change email address'
click_link 'Change email address'

fill_in 'New email', with: '[email protected]'
fill_in 'Current password', with: 'Secret1*3*5*'
click_on 'Save changes'
click_button 'Save changes'

assert_text 'Your email has been changed'
end

test 'sending a verification email' do
@user.update! verified: false

click_on 'Change email address'
click_on 'Re-send verification email'
click_link 'Change email address'
click_button 'Re-send verification email'

assert_text 'We sent a verification email to your email address'
end
Expand Down
6 changes: 3 additions & 3 deletions test/system/identity/password_resets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class PasswordResetsTest < ApplicationSystemTestCase

test 'sending a password reset email' do
visit sign_in_url
click_on 'Forgot your password?'
click_link 'Forgot your password?'

fill_in 'Email', with: @user.email
click_on 'Send password reset email'
click_button 'Send password reset email'

assert_text 'Check your email for reset instructions'
end
Expand All @@ -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_on 'Save changes'
click_button 'Save changes'

assert_text 'Your password was reset successfully. Please sign in'
end
Expand Down
2 changes: 1 addition & 1 deletion test/system/interests_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InterestsTest < ApplicationSystemTestCase
fill_in 'Email', with: @interest.email

assert_emails 1 do
click_on 'Submit'
click_button 'Submit'
end

assert_text "We've sent you an 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 @@ -8,12 +8,12 @@ class PasswordsTest < ApplicationSystemTestCase
end

test 'updating the password' do
click_on 'Change password'
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_on 'Save changes'
click_button 'Save changes'

assert_text 'Your password has been changed'
end
Expand Down
6 changes: 3 additions & 3 deletions test/system/sessions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ class SessionsTest < ApplicationSystemTestCase
test 'visiting the index' do
sign_in_as @user

click_on 'Access log'
click_link 'Access log'
assert_selector 'h1', text: 'Sessions'
end

test 'signing in' do
visit sign_in_url
fill_in 'Email', with: @user.email
fill_in 'Password', with: 'Secret1*3*5*'
click_on 'Sign in'
click_button 'Sign in'

assert_text 'Signed in successfully'
end

test 'signing out' do
sign_in_as @user

click_on 'Log out'
click_button 'Log out'
assert_text 'That session has been logged out'
end
end
10 changes: 5 additions & 5 deletions test/system/tracks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class TracksTest < ApplicationSystemTestCase

test 'should create track' do
visit artist_album_url(@track.artist, @track.album)
click_on 'Add track'
click_link 'Add track'

fill_in 'Title', with: @track.title
attach_file 'File', Rails.root.join('test/fixtures/files/track.wav')
click_on 'Save'
click_button 'Save'

assert_text "2. #{@track.title}"
end
Expand All @@ -23,9 +23,9 @@ class TracksTest < ApplicationSystemTestCase
visit artist_album_url(@track.artist, @track.album)
assert_text "1. #{@track.title}"

click_on 'Edit'
click_link 'Edit'
fill_in 'Title', with: 'New title'
click_on 'Save'
click_button 'Save'

assert_text '1. New title'
end
Expand All @@ -35,7 +35,7 @@ class TracksTest < ApplicationSystemTestCase
assert_text "1. #{@track.title}"

accept_confirm do
click_on 'Delete'
click_link 'Delete'
end

assert_no_text "1. #{@track.title}"
Expand Down

0 comments on commit 4ce9818

Please sign in to comment.