From 5d92d2464b58d4e050b469957fd343f5f9791084 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 8 May 2012 18:21:38 -0700 Subject: [PATCH] fix email spec; nokogiri needs a top-leve element --- features/step_definitions/user_steps.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index b9aafea44..c2a7897a0 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -112,7 +112,8 @@ end And /^I follow the "([^\"]*)" link from the last sent email$/ do |link_text| email_text = Devise.mailer.deliveries.first.body.to_s email_text = Devise.mailer.deliveries.first.html_part.body.raw_source if email_text.blank? - doc = Nokogiri(email_text) + doc = Nokogiri("
" + email_text + "
") + links = doc.css('a') link = links.detect{ |link| link.text == link_text } link = links.detect{ |link| link.attributes["href"].value.include?(link_text)} unless link