Once saving a rate, the user is redirected to the rate list. #1914
This commit is contained in:
@@ -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" }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user