Created
March 3, 2010 20:39
-
-
Save siannopollo/320985 to your computer and use it in GitHub Desktop.
Apply styles to pages opened by Webrat (0.6.0)
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
Webrat::SaveAndOpenPage.module_eval do | |
def rewrite_css_and_image_references(response_html) | |
response_html.gsub(/("|')\/(stylesheets|images|javascripts)/) {"#{$1}../public/#{$2}"} | |
end | |
def saved_page_dir | |
File.expand_path('./tmp') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment