-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually fix new unsafe Rubcop offences #4735
* Requires fixing some specs as some elements became ambiguous due to preferring more generic `click_on` Capybara helper instead of `click_link` and `click_button` * Solved by searching within `form` - alternatively, we could use test_ids. Probably a more robust approach, but preferred not having to touch views for this pass
- Loading branch information
1 parent
b327e52
commit c50dfc0
Showing
11 changed files
with
58 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,12 @@ | |
# Create a new invitation | ||
visit admin_team_path | ||
|
||
click_link('Invite new member') | ||
click_on('Invite new member') | ||
|
||
fill_in('Name', with: 'John Doe') | ||
fill_in('Email', with: '[email protected]') | ||
select('Core', from: 'Role') | ||
click_button('Send invite') | ||
click_on('Send invite') | ||
|
||
expect(page).to have_content('Invitation sent to [email protected]') | ||
expect(page).to have_content('John Doe') | ||
|
@@ -21,19 +21,19 @@ | |
using_session('john') do | ||
open_email('[email protected]') | ||
expect(current_email.subject).to match(/Joining The Odin Project Admin Team/) | ||
current_email.click_link('Join the team') | ||
current_email.click_on('Join the team') | ||
|
||
expect(page).to have_content('Welcome to the team!') | ||
|
||
find(:test_id, 'password-field').fill_in(with: 'supersecretpassword') | ||
find(:test_id, 'password-confirmation-field').fill_in(with: 'supersecretpassword') | ||
click_button('Submit') | ||
click_on('Submit') | ||
|
||
expect(page).to have_current_path(new_admin_two_factor_authentication_path) | ||
|
||
freeze_time do | ||
find(:test_id, 'otp-code-field').fill_in(with: otp_code_for(AdminUser.last)) | ||
click_button('Confirm') | ||
click_on('Confirm') | ||
end | ||
|
||
expect(page).to have_current_path(admin_dashboard_path) | ||
|
@@ -47,12 +47,12 @@ | |
# Create a new invitation | ||
visit admin_team_path | ||
|
||
click_link('Invite new member') | ||
click_on('Invite new member') | ||
|
||
fill_in('Name', with: 'John Doe') | ||
fill_in('Email', with: '[email protected]') | ||
select('Core', from: 'Role') | ||
click_button('Send invite') | ||
click_on('Send invite') | ||
|
||
expect(page).to have_content('Invitation sent to [email protected]') | ||
expect(page).to have_content('John Doe') | ||
|
@@ -61,17 +61,17 @@ | |
using_session('john') do | ||
open_email('[email protected]') | ||
expect(current_email.subject).to match(/Joining The Odin Project Admin Team/) | ||
current_email.click_link('Join the team') | ||
current_email.click_on('Join the team') | ||
|
||
expect(page).to have_content('Welcome to the team!') | ||
|
||
find(:test_id, 'password-field').fill_in(with: 'supersecretpassword') | ||
find(:test_id, 'password-confirmation-field').fill_in(with: 'supersecretpassword') | ||
click_button('Submit') | ||
click_on('Submit') | ||
|
||
expect(page).to have_current_path(new_admin_two_factor_authentication_path) | ||
|
||
click_link('Dashboard') | ||
click_on('Dashboard') | ||
expect(page).to have_current_path(new_admin_two_factor_authentication_path) | ||
expect(page).to have_content('Please enable two factor authentication before continuing.') | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
find(:test_id, 'dropdown-button').click | ||
|
||
accept_confirm do | ||
click_link('Reactivate') | ||
click_on('Reactivate') | ||
end | ||
end | ||
|
||
|
@@ -25,17 +25,17 @@ | |
using_session('deactivated_admin') do | ||
open_email('[email protected]') | ||
expect(current_email.subject).to match(/Joining The Odin Project Admin Team/) | ||
current_email.click_link('Join the team') | ||
current_email.click_on('Join the team') | ||
|
||
find(:test_id, 'password-field').fill_in(with: 'supersecretpassword') | ||
find(:test_id, 'password-confirmation-field').fill_in(with: 'supersecretpassword') | ||
click_button('Submit') | ||
click_on('Submit') | ||
|
||
expect(page).to have_current_path(new_admin_two_factor_authentication_path) | ||
|
||
freeze_time do | ||
find(:test_id, 'otp-code-field').fill_in(with: otp_code_for(deactivated_admin.reload)) | ||
click_button('Confirm') | ||
click_on('Confirm') | ||
end | ||
|
||
expect(page).to have_current_path(admin_dashboard_path) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters