Having a strange problem with rspec and rails in controller tests. Whenever we add puts response inside the specification, it outputs a lot 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 with SystemStackError: stack level too deep . Checking the answer through pry works fine, printing other materials also works great.
Upgrading to the latest version of rspec (2.11) does not matter. We noticed that puts calls the to_a answer on the answer that returns the array [@status, @header, self] , so for some reason does this cause this weird recursion?
update : here is a gist with code + spec
source share