Created
March 2, 2010 18:30
-
-
Save diasjorge/319762 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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