Having a strange problem with rspec and rails in controller tests. Whenever we add puts response
inside a spec, it outputs lots of these
200
{"Content-Type"=>"text/html; charset=utf-8"}
200
{"Content-Type"=>"text/html; charset=utf-8"}
200
{"Content-Type"=>"text/html; charset=utf-8"}
200
{"Content-Type"=>"text/html; charset=utf-8"}
and then fails with SystemStackError: stack level too deep
. Inspecting the response via pry works great, printing other stuff also works fine.
Upgrading to latest rspec (2.11) does not make a difference. We noticed that the puts calls to_a
on the response, which returns an array of [@status, @header, self]
, so somehow it causes this strange recursion?
update: here's a gist with the code + spec