Hello,

I have a view that generates a list of adverts with <%=  
render :partial => 'advert', :collection => @adverts %>

I have the render call described with  
@controller.template.should_receive(:render).with(:partial =>  
'advert', :collection => @adverts)

Bu when i was about to describe my partial i got stuck.

My partial _advert.rhtml:

<div id="advert_<%= advert.id %>">
        <h3><%=h advert.title %></h3>
        <p><%=h advert.description %></p>
</div>

And to describe that: http://pastie.textmate.org/91995

The problem is that (assigns[:advert] = advert) creates an instance  
variable and :collection => @adverts creates a local variable called  
advert.

Is there a way of assigning a local variables in a view/template from  
my description/spec?

Cheers!

Mathias Stjernstrom


_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to