[rspec-users] [Cucumber] Successive requests with xml Content-Type fail?

Wolfram Arnold lists at ruby-forum.com
Mon Jun 22 02:53:15 EDT 2009

I'm writing a cucumber test for an xml webservice.  When making POST's
the Content-Type in the header is set to "application/xml" and for any
request, the Accept header is set to "application/xml" (aka

I'm running into the following issue:

When I make two successive requests, the first one being a POST to log
the user in; the second one a GET to retrieve some data, the second
request always seems to fail with this error:

      private method `split' called for #<Mime::Type:0x7f60a708ff70>

This started happening only in Rails 2.3.  It previously worked fine
with Rails 2.0

Now, I dug into this some more; the Session class in webrat core seems
to get instantiated once for the entire scenario and the instance sticks
around for all of the requests.  I noticed by checking with the
debugger, that the header object gets transformed into a Rack header
object and acquires things like the referrer field from the first
request.  On the second request (the GET), the Content-Type is set but
it probably shouldn't--as there is no payload data, it's a GET--and that
causes havoc.  I'm kind of lost as to whether this is a bug in Rack or
Rails or Webrat or whether I'm doing something wrong.

Any advice is appreciated.
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list