And I suspect this is because @first_render isn't being set for subsequent renders.... but it's time to go home now.<br><br><div><span class="gmail_quote">On 02/04/2008, <b class="gmail_sendername">Tim Haines</b> <<a href="mailto:tmhaines@gmail.com">tmhaines@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>Made a little progress here. In one of my "given" steps I was posting to the login action. when I take this post out (and make other changes required), the should render_template works correctly. It's as though the earlier post in the given step is meaning that the response isn't set correctly after the later post..<br>
<span class="sg">
<br>Tim. <br></span><div><span class="e" id="q_1190d50ab6f9e790_2"><br><div><span class="gmail_quote">On 02/04/2008, <b class="gmail_sendername">Tim Haines</b> <<a href="mailto:tmhaines@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tmhaines@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi y'all<br><br>The problem is probably because I'm a newb. I have a home controller in the admin namespace. <br><br>My controller spec is working as expected, and the following example is passing:<br><br> it "should show the home page if logged in" do<br>
controller.send("current_user=", User.new)<br> get :index<br> response.should render_template('admin/home/index')<br> end<br><br><br>But my story is failing on the "then" step:<br><br>
When "I view the home page" do <br> get admin_url<br> end<br><br> Then "I see the home page" do<br> response.should_not be_redirect # this passes<br> response.code.should == "200" # this passes<br>
<br> response.should have_text(/"Client Administration."/) #this fails, as response.body is nil<br> response.should render_template("admin/home/index") #this fails, with actual being nil.<br>
end<br><br>It's as though the template isn't actually being rendered for some reason. Any clues as to why this might be? My login story uses render_template in a similar way and it works successfully..<br><br>
Cheers,<br><span><br>Tim.<br> <br>
</span></blockquote></div><br>
</span></div></blockquote></div><br>