Testing across multiple sessions in merb using webrat
Posted
by m7d
on Stack Overflow
See other posts from Stack Overflow
or by m7d
Published on 2010-05-25T20:15:35Z
Indexed on
2010/05/25
20:21 UTC
Read the original article
Hit count: 541
I want to test across multiple sessions using webrat in merb. Apparently, this is fairly easy to accomodate in Rails via: http://erikonrails.snowedin.net/?p=159.
Following the same logic, I am trying to do something that follows that pattern for merb and webrat. Here is an attempt (which does not work because MerbAdapter does not respond to visit and other webrat session methods; I don't want to take too much more time with this so I have stopped here for now):
# defined in test.rb environment file
module Merb #:nodoc:
module Test #:nodoc:
module RequestHelper #:nodoc:
def in_a_separate_session
old = @_webrat_session.response.clone
@_webrat_session = Webrat::MerbAdapter.new
yield
@_webrat_session.response = old
end
end
end
end
I tried a few other ideas, but obviously I am missing something. Anyone else know how this would be done in merb? I think I could specify a cookie jar using the request mock, but I prefer to do this with webrat.
© Stack Overflow or respective owner