-
-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor system tests to pass in DevContainers
- Loading branch information
1 parent
e5b0e6e
commit e24db8b
Showing
20 changed files
with
184 additions
and
156 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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
require "test_helper" | ||
require "application_system_test_case" | ||
require "helpers/email_helpers" | ||
|
||
class EmailConfirmationTest < SystemTest | ||
class EmailConfirmationTest < ApplicationSystemTestCase | ||
include ActiveJob::TestHelper | ||
|
||
setup do | ||
|
@@ -19,7 +19,7 @@ def request_confirmation_mail(email) | |
test "requesting confirmation mail does not tell if a user exists" do | ||
request_confirmation_mail "[email protected]" | ||
|
||
assert page.has_content? "We will email you confirmation link to activate your account if one exists." | ||
assert_text "We will email you confirmation link to activate your account if one exists." | ||
end | ||
|
||
test "requesting confirmation mail with email of existing user" do | ||
|
@@ -30,8 +30,8 @@ def request_confirmation_mail(email) | |
assert_not_nil link | ||
visit link | ||
|
||
assert page.has_content? "Sign in" | ||
assert page.has_selector? "#flash_notice", text: "Your email address has been verified" | ||
assert_text "Sign in" | ||
assert_selector "#flash_notice", text: "Your email address has been verified" | ||
end | ||
|
||
test "re-using confirmation link, asks user to double check the link" do | ||
|
@@ -40,13 +40,13 @@ def request_confirmation_mail(email) | |
link = last_email_link | ||
visit link | ||
|
||
assert page.has_content? "Sign in" | ||
assert page.has_selector? "#flash_notice", text: "Your email address has been verified" | ||
assert_text "SIGN IN" | ||
assert_selector "#flash_notice", text: "Your email address has been verified" | ||
|
||
visit link | ||
|
||
assert page.has_content? "Sign in" | ||
assert page.has_selector? "#flash_alert", text: "Please double check the URL or try submitting it again." | ||
assert_text "SIGN IN" | ||
assert_selector "#flash_alert", text: "Please double check the URL or try submitting it again." | ||
end | ||
|
||
test "requesting multiple confirmation email" do | ||
|
@@ -77,8 +77,8 @@ def request_confirmation_mail(email) | |
fill_in "otp", with: ROTP::TOTP.new(@user.totp_seed).now | ||
click_button "Authenticate" | ||
|
||
assert page.has_content? "Sign in" | ||
assert page.has_selector? "#flash_notice", text: "Your email address has been verified" | ||
assert_text "Sign in" | ||
assert_selector "#flash_notice", text: "Your email address has been verified" | ||
end | ||
|
||
test "requesting confirmation mail with webauthn enabled" do | ||
|
@@ -91,15 +91,15 @@ def request_confirmation_mail(email) | |
assert_not_nil link | ||
visit link | ||
|
||
assert page.has_content? "Multi-factor authentication" | ||
assert page.has_content? "Security Device" | ||
assert_text "Multi-factor authentication" | ||
assert_text "Security Device" | ||
|
||
click_on "Authenticate with security device" | ||
|
||
assert page.has_content? "Sign in" | ||
assert_text "SIGN IN" | ||
skip("There's a glitch where the webauthn javascript(?) triggers the next page to render twice, clearing flash.") | ||
|
||
assert page.has_selector? "#flash_notice", text: "Your email address has been verified" | ||
assert_selector "#flash_notice", text: "Your email address has been verified" | ||
end | ||
|
||
test "requesting confirmation mail with webauthn enabled using recovery codes" do | ||
|
@@ -112,14 +112,14 @@ def request_confirmation_mail(email) | |
assert_not_nil link | ||
visit link | ||
|
||
assert page.has_content? "Multi-factor authentication" | ||
assert page.has_content? "Security Device" | ||
assert_text "Multi-factor authentication" | ||
assert_text "Security Device" | ||
|
||
fill_in "otp", with: @mfa_recovery_codes.first | ||
click_button "Authenticate" | ||
|
||
assert page.has_content? "Sign in" | ||
assert page.has_selector? "#flash_notice", text: "Your email address has been verified" | ||
assert_text "Sign in" | ||
assert_selector "#flash_notice", text: "Your email address has been verified" | ||
end | ||
|
||
test "requesting confirmation mail with mfa enabled, but mfa session is expired" do | ||
|
@@ -135,7 +135,7 @@ def request_confirmation_mail(email) | |
travel 16.minutes do | ||
click_button "Authenticate" | ||
|
||
assert page.has_content? "Your login page session has expired." | ||
assert_text "Your login page session has expired." | ||
end | ||
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
Oops, something went wrong.