diff --git a/app/controllers/rates_controller.rb b/app/controllers/rates_controller.rb index 6a9c3bc..fcc811c 100644 --- a/app/controllers/rates_controller.rb +++ b/app/controllers/rates_controller.rb @@ -108,7 +108,7 @@ class RatesController < ApplicationController @rate.destroy respond_to do |format| - format.html { redirect_to(rates_url) } + format.html { redirect_to(rates_url(:user_id => @rate.user_id)) } format.xml { head :ok } end end diff --git a/spec/controllers/rates_controller_spec.rb b/spec/controllers/rates_controller_spec.rb index 9b4060c..9b6a9f9 100644 --- a/spec/controllers/rates_controller_spec.rb +++ b/spec/controllers/rates_controller_spec.rb @@ -421,10 +421,10 @@ describe RatesController, "as an administrator" do delete :destroy, :id => "37" end - it "should redirect to the rates list" do + it "should redirect to the user's rates list" do Rate.stub!(:find).and_return(mock_rate(:destroy => true)) delete :destroy, :id => "1" - response.should redirect_to(rates_url) + response.should redirect_to(rates_url(:user_id => @user.id)) end end