diff --git a/test/acceptance/email_change_test.rb b/test/acceptance/email_change_test.rb index ac39ea55..ffab6e17 100644 --- a/test/acceptance/email_change_test.rb +++ b/test/acceptance/email_change_test.rb @@ -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 team@jackhq.com", page.body - + within 'div.flash' do + assert has_content? "A link to confirm your updated email address has been sent to team@jackhq.com" + 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