
rails mode save_and_open_page saves into RAILS_ROOT
Reported by tomo | August 18th, 2009 @ 11:27 AM
After f2b3b9891b9a0605fa2d6197f9a960f9c7dbd361, save_and_open_page in Rails mode saves into RAILS_ROOT instead of RAILS_ROOT/tmp.
It seems the problem is that the RailsSession is now an adapter, so when save_and_open_page is called on the Session, the RailsSession's saved_page_dir is not used. Previously the RailsSession overrode saved_page_dir in the Session itself.
Not sure what should be done about this. Delegating to the adapter would fix it for Rails mode but break it for others.
Comments and changes to this ticket
-
danny.kavanna (at googlemail) September 9th, 2009 @ 10:24 AM
How about allowing an environment variable to override the default setting in saved_page_dir?
-
Adam S November 6th, 2009 @ 06:01 PM
I have this in my 'support/env.rb' (I'm using cucumber)
It fixes it for me.
# webrat default to saving output files in '.' # should save in tmp module Webrat module SaveAndOpenPage def saved_page_dir #:nodoc: File.expand_path("./tmp") end end end
-
Ryan Bigg November 12th, 2009 @ 01:40 AM
Patch to solve this: http://github.com/radar/webrat/commit/d5d829de723a34a1059324b06286b...
Currently available as radar-webrat on gemcutter.
-
Bryan Helmkamp November 15th, 2009 @ 05:04 PM
Instead of making this an adapter concern, what if we always use ./tmp/webrat? We can mkdir_p it if it doesn't exist. Seems better for any application.
Thoughts?
-
Noah January 16th, 2010 @ 07:44 PM
Just saw this ticket after my most recent commit to address this. I agree this shouldn't really be an adapter concern. I created a webrat configuration option "saved_pages_dir" for this that defaults to the current directory.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby Acceptance Testing for Web applications.