Once deleting a Rate, the user should be redirected back to the user rate list. #1919
This commit is contained in:
1 parent
3fccd98102
commit
a294ff0154
2 files changed
+3
-3
No files matched your search
@@ -108,7 +108,7 @@ class RatesController < ApplicationController
|
|||||||
@rate.destroy
|
@rate.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
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 }
|
format.xml { head :ok }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -421,10 +421,10 @@ describe RatesController, "as an administrator" do
|
|||||||
delete :destroy, :id => "37"
|
delete :destroy, :id => "37"
|
||||||
end
|
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))
|
Rate.stub!(:find).and_return(mock_rate(:destroy => true))
|
||||||
delete :destroy, :id => "1"
|
delete :destroy, :id => "1"
|
||||||
response.should redirect_to(rates_url)
|
response.should redirect_to(rates_url(:user_id => @user.id))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user