How do I write a spec to verify the rendering of partials?
Posted
by TheDeeno
on Stack Overflow
See other posts from Stack Overflow
or by TheDeeno
Published on 2010-05-18T22:35:16Z
Indexed on
2010/05/18
22:40 UTC
Read the original article
Hit count: 292
I'm using rr and rspec. Also, I'm using the collection short hand for partial rendering. My question: How do I correctly fill out the the following spec?
before(:each) do
assigns[:models] = Array.new(10, stub(Model))
end
it "should render the 'listing' partial for each model" do
# help me write something that actually verifies this
end
I've tried a few examples from the rspec book, rspec docs, and rr docs. Everything I try seems to leave me with runtime errors in the test - not failed assertions. Rather than show all the transformations I've tried, I figured all I'd need if someone showed me one that actually worked. I'd be good to go from there.
© Stack Overflow or respective owner