Once saving a rate, the user is redirected to the rate list. #1914

This commit is contained in:
Eric Davis
2009-01-19 11:22:42 -08:00
parent b7a4850b06
commit cc063768b6
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ class RatesController < ApplicationController
respond_to do |format|
if @rate.save
flash[:notice] = 'Rate was successfully created.'
format.html { redirect_to(@rate) }
format.html { redirect_to(rates_url(:user_id => @rate.user_id)) }
format.xml { render :xml => @rate, :status => :created, :location => @rate }
else
format.html { render :action => "new" }
+2 -2
View File
@@ -266,10 +266,10 @@ describe RatesController, "as an administrator" do
assigns(:rate).should equal(mock_rate)
end
it "should redirect to the created rate" do
it "should redirect to the rate list" do
Rate.stub!(:new).and_return(mock_rate(:save => true))
post :create, :rate => {}
response.should redirect_to(rate_url(mock_rate))
response.should redirect_to(rates_url(:user_id => @user.id))
end
end