Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created March 2, 2010 18:30
Show Gist options
  • Save diasjorge/319762 to your computer and use it in GitHub Desktop.
Save diasjorge/319762 to your computer and use it in GitHub Desktop.
module SaveAndOpenEmail
include Webrat::SaveAndOpenPage
def save_and_open_email(email)
return unless File.exist?(saved_page_dir)
filename = "#{saved_page_dir}/email-#{Time.now.to_i}.html"
File.open(filename, "w") do |f|
f.write rewrite_css_and_image_references(email.to_s)
end
open_in_browser(filename)
end
def doc_root
Rails.root.join("public")
end
end
World(SaveAndOpenEmail)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment