views:

33

answers:

0

I'm using rr (the mocking framework) and rspec with ruby-on-rails. Also, I'm using the collection short hand for partial rendering. My question: How do I correctly fill out the the following view spec?

describe 'my_view' do
  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
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.