Once saving a rate, the user is redirected to the rate list. #1914
This commit is contained in:
1 parent
b7a4850b06
commit
cc063768b6
2 files changed
+3
-3
No files matched your search
@@ -49,7 +49,7 @@ class RatesController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @rate.save
|
if @rate.save
|
||||||
flash[:notice] = 'Rate was successfully created.'
|
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 }
|
format.xml { render :xml => @rate, :status => :created, :location => @rate }
|
||||||
else
|
else
|
||||||
format.html { render :action => "new" }
|
format.html { render :action => "new" }
|
||||||
|
|||||||
@@ -266,10 +266,10 @@ describe RatesController, "as an administrator" do
|
|||||||
assigns(:rate).should equal(mock_rate)
|
assigns(:rate).should equal(mock_rate)
|
||||||
end
|
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))
|
Rate.stub!(:new).and_return(mock_rate(:save => true))
|
||||||
post :create, :rate => {}
|
post :create, :rate => {}
|
||||||
response.should redirect_to(rate_url(mock_rate))
|
response.should redirect_to(rates_url(:user_id => @user.id))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user