I already tried that and I get<br><br>NoMethodError: undefined method `body' for nil:NilClass<br><br>Two days trying to solve this :-(<br><br><div class="gmail_quote">On 27 July 2010 14:58, Mr Jaba <span dir="ltr"><<a href="mailto:the.jaba@gmail.com">the.jaba@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Tim has hit the nail on the head there, there will be no response.body either @response or app.response until you have made the request (the delete line).<br>
Move the put down after the delete and try again. <br><br><br><br>
<div class="gmail_quote"><div><div></div><div class="h5">On 27 July 2010 14:56, Tim Cowlishaw <span dir="ltr"><<a href="mailto:tim@timcowlishaw.co.uk" target="_blank">tim@timcowlishaw.co.uk</a>></span> wrote:<br></div>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
<div style="word-wrap: break-word;"><br><div><div><div>On 27 Jul 2010, at 14:43, Riccardo Tacconi wrote:</div><br></div><blockquote type="cite"><div class="gmail_quote"><div>On 27 July 2010 13:21, Murray Steele <span dir="ltr"><<a href="mailto:murray.steele@gmail.com" target="_blank">murray.steele@gmail.com</a>></span> wrote:</div>
<div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div><div><div> should "delete :destroy participations" do<br>
</div>
app = ApplicationController.new</div><div><div> puts app.response.body</div><div> assert_difference('Participation.count', -1) do<br> delete :destroy, :id => @p.to_param<br> end<br>
end<br><br></div></div></div></div></blockquote><div><br><b>Ok, but it does not print anything</b><br> </div></div></div></blockquote><br></div><div>To caveat, I'm not massively familiar with either Test::Unit or Shoulda, but I can't quite see what this ApplicationController instance you're creating has to do with the request that your test is making. if you look in the testing guide: <a href="http://guides.rubyonrails.org/testing.html#functional-tests-for-your-controllers" target="_blank">http://guides.rubyonrails.org/testing.html#functional-tests-for-your-controllers</a>, you'll see that the request methods (like delete in your code) populate an instance variable called @response with the response of the request. try inspecting the body of this object in order to see what the response of your request was.</div>
<div><br></div><div>Cheers,</div><div><br></div><font color="#888888"><div>Tim</div><div><br></div><div><br></div></font></div><br></div></div><div class="im">_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Tacconi<br>Web developer at Wolseley UK <br><br><a href="http://www.linkedin.com/in/riccardotacconi">http://www.linkedin.com/in/riccardotacconi</a><br><a href="http://riccardotacconi.blogspot.com/">http://riccardotacconi.blogspot.com/</a><br>
<a href="http://twitter.com/rtacconi">http://twitter.com/rtacconi</a><br>Linux user: #400461<br>