Forum: RSpec RSpec-Rails 1.2.2 and Controllers without views - what to do?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
439c401f95ee2fac0be4c1727dd74dea?d=identicon&s=25 Bira (Guest)
on 2009-04-01 22:15
(Received via mailing list)
I'm trying to upgrade to RSpec 1.2.2 in a Rails app, and reading
Upgrade.rdoc I see that now every controller action must have a
corresponding template for their specs to pass. However, we have a few
controllers which only return XML or JSON as generated by Rails'
to_xml and to_json methods, and so use only render :xml/:json calls
rather than views. With 1.2.2, we get a lot of failing specs in that
section that used to pass with 1.1.12, because of the "missing"
templates.

What do you recommend I do in this case? Is there any good solution
other than making up templates consisting entirely of a single "<%=
@obj.to_xml %>" line?

--
Bira
http://compexplicita.wordpress.com
http://compexplicita.tumblr.com
2837408ba0375c40b235f0a5a5107d37?d=identicon&s=25 Doug Livesey (biot023)
on 2009-04-08 22:08
(Received via mailing list)
Hi. Bira -- just got the same problem myself, and have found that
(whilst
not a perfect solution) that stubbing out render on the controller in my
before block solves it.
controller.stub!( :render )

HTH,
   Doug.

2009/4/1 Bira <u.alberton@gmail.com>
This topic is locked and can not be replied to.