Testing layouts with RSpec on Rails

On Tue, 23 Oct 2007 03:16:32 +0000, Steve wrote:

Submitted as issue #14969.
I don’t know if there are any repercussions, but just adding :text to
the
array in
rspec_on_rails/lib/spec/rails/dsl/behaviour/view_example.rb:subject_of_render
was enough to make it work.

Steve

On 10/23/07, Steve [email protected] wrote:

Good idea. Feature request please.

Submitted as issue #14969.

I don’t know if there are any repercussions, but just adding :text to the
array in
rspec_on_rails/lib/spec/rails/dsl/behaviour/view_example.rb:subject_of_render
was enough to make it work.

That’s cool, but that’s not how we do things. Please submit a patch
with specs. :wink:

Its a typo (sort of). I actually call it on response rather than
controller, which does have the layout

it “should use application layout” do
do_it
response.should use_layout(“application”)
end

On Tue, 23 Oct 2007 17:58:45 -0500, David C. wrote:

I don’t know if there are any repercussions, but just adding :text to the
array in
rspec_on_rails/lib/spec/rails/dsl/behaviour/view_example.rb:subject_of_render
was enough to make it work.

That’s cool, but that’s not how we do things. Please submit a patch
with specs. :wink:

Yeah, I know. I was just stating that that’s all that was needed. I’m
not
entirely sure what would be needed to verify that it doesn’t have
unintended consequences.