I have this test:<br><br> context "should destroy participation" do<br> setup do<br> @configuration = Factory.create :configuration, :status => 'LIVE'<br> @p = Factory.create :participation, :configuration => @configuration<br>
@admin = Factory.create :participant, :admin => true<br> login_as @admin<br> end<br><br> should "delete :destroy participations" do<br> assert_difference('Participation.count', -1) do<br>
delete :destroy, :id => @p.to_param<br> end<br> end<br><br> should_redirect_to("redirect to edit configuration") { edit_configuration_path @configuration }<br> # should_set_the_flash_to "The host has been unassociated."<br>
end<br><br>The shoulda context tests this controller action:<br><br> def destroy<br> @participation = Participation.find(params[:id])<br> @c = Configuration.find @participation.configuration_id<br> @participation.destroy<br>
flash[:notice] = 'The host has been unassociated.'<br> <br> respond_to do |format|<br> format.html { redirect_to(edit_configuration_path @c) }<br> end<br> end<br><br><br>I get this message as failed test:<br>
<br>Expected response to be a <:redirect>, but was <200><br><br>But why? That method really return a 302 (redirrect) method. Do I miss something?<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>