[LRUG] Expected response to be a <:redirect>, but was <200> when using should_redirect_to
Riccardo Tacconi
rtacconi at gmail.com
Mon Jul 26 10:05:56 PDT 2010
I have this test:
context "should destroy participation" do
setup do
@configuration = Factory.create :configuration, :status => 'LIVE'
@p = Factory.create :participation, :configuration => @configuration
@admin = Factory.create :participant, :admin => true
login_as @admin
end
should "delete :destroy participations" do
assert_difference('Participation.count', -1) do
delete :destroy, :id => @p.to_param
end
end
should_redirect_to("redirect to edit configuration") {
edit_configuration_path @configuration }
# should_set_the_flash_to "The host has been unassociated."
end
The shoulda context tests this controller action:
def destroy
@participation = Participation.find(params[:id])
@c = Configuration.find @participation.configuration_id
@participation.destroy
flash[:notice] = 'The host has been unassociated.'
respond_to do |format|
format.html { redirect_to(edit_configuration_path @c) }
end
end
I get this message as failed test:
Expected response to be a <:redirect>, but was <200>
But why? That method really return a 302 (redirrect) method. Do I miss
something?
--
Riccardo Tacconi
Web developer at Wolseley UK
http://www.linkedin.com/in/riccardotacconi
http://riccardotacconi.blogspot.com/
http://twitter.com/rtacconi
Linux user: #400461
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100726/403efe92/attachment-0003.html>
More information about the Chat
mailing list