I'm trying to spec a view but haven't done much view specing.<br><br>This view render different partials depending on authentication of the user: annon, admin, player<br>So I I'll write if conditionals in the view with the partials
<br><br><br> it "should render signup propaganda for annon users trying to view games" do<br> render "/games/index.rhtml"<br> @logged_in?.should eql(false)<br> response.should render_template('_signup_propaganda')
<br> end<br><br>Now for my partial I know it'll be wrapped all in a div with a class="signup_propaganda"<br>Should I be testing for that instead? Can I write expectations for partials similar to above?<br><br>
When your specing views are you testing for the outputted results?<br><br> it "should render signup propaganda for annon users trying to view games" do<br>
render "/games/index.rhtml"<br>
@logged_in?.should eql(false)<br>
response.should have_tag(div, "class=/"signup_propaganda/"")<br>
end<br><br>How should I be writing my spec?<br>