forked from hotsh/rstat.us
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor email_change_test to use css selector
- Loading branch information
1 parent
8c01177
commit 74c8414
Showing
1 changed file
with
15 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,9 @@ | |
|
||
# Need to figure out the best way to do this, expects is swallowing up token generation... | ||
# refute u.perishable_token.nil? | ||
assert_match "A link to confirm your updated email address has been sent to [email protected]", page.body | ||
|
||
within 'div.flash' do | ||
assert has_content? "A link to confirm your updated email address has been sent to [email protected]" | ||
end | ||
end | ||
|
||
end | ||
|
@@ -36,7 +37,10 @@ | |
token = u.create_token | ||
visit "/confirm_email/#{token}" | ||
|
||
assert_match "Email successfully confirmed.", page.body | ||
within 'div.flash' do | ||
assert has_content? "Email successfully confirmed." | ||
end | ||
|
||
assert_match "/", page.current_url | ||
|
||
u.reload | ||
|
@@ -46,7 +50,10 @@ | |
it "rejects an invalid token" do | ||
visit "/confirm_email/abcd" | ||
|
||
assert_match "Can't find User Account for this link.", page.body | ||
within 'div.flash' do | ||
assert has_content? "Can't find User Account for this link." | ||
end | ||
|
||
assert_match "/", page.current_url | ||
|
||
end | ||
|
@@ -61,7 +68,10 @@ | |
|
||
visit "/confirm_email/#{token}" | ||
|
||
assert_match "Your link is no longer valid, please request a new one.", page.body | ||
within 'div.flash' do | ||
assert has_content? "Your link is no longer valid, please request a new one." | ||
end | ||
|
||
assert_match "/", page.current_url | ||
|
||
end | ||
|