Skip to content

Commit

Permalink
refactor email_change_test to use css selector
Browse files Browse the repository at this point in the history
  • Loading branch information
caleywoods committed Feb 17, 2012
1 parent 8c01177 commit 74c8414
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/acceptance/email_change_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 74c8414

Please sign in to comment.