Skip to content
Browse files

Hack to unify Rails and Webrat session under Rails 3

  • Loading branch information...
1 parent 9da815a commit fbc2c736c9e4a2cfabf8a6c385980490206fdfc8 @brynary committed Jul 24, 2010
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/webrat/core/methods.rb
View
9 lib/webrat/core/methods.rb
@@ -23,6 +23,15 @@ def webrat_session
end
end
+ # Temporary hack to work with Rails 3
+ def response
+ if Webrat.configuration.mode == :rack
+ webrat_session.response
+ else
+ super
+ end
+ end
+
# all of these methods delegate to the @session, which should
# be created transparently.
#

3 comments on commit fbc2c73

@arthwood

Hi,
I think this hack causes errors when running rspec tests in Rails 3. This is what I get:
Failure/Error: Unable to find matching line from backtrace
stack level too deep
# C:/ruby/lib/ruby/1.9.1/forwardable.rb:185

Apparently webrat_session.response calls response recursively

@dolzenko

+1 having the same issue with 0.7.2 (resolved by downgrading to 0.7.1)

Please sign in to comment.
Something went wrong with that request. Please try again.