some better http status codes
This commit is contained in:
parent
e925fe622c
commit
4c696603c6
7 changed files with 8 additions and 8 deletions
|
|
@ -137,7 +137,7 @@ class AspectsController < ApplicationController
|
||||||
else
|
else
|
||||||
flash[:error] = I18n.t 'aspects.update.failure', :name => @aspect.name
|
flash[:error] = I18n.t 'aspects.update.failure', :name => @aspect.name
|
||||||
end
|
end
|
||||||
render :nothing => true
|
render :nothing => true, :status => 204
|
||||||
end
|
end
|
||||||
|
|
||||||
def toggle_contact_visibility
|
def toggle_contact_visibility
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class CommentsController < ApplicationController
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.mobile {redirect_to :back}
|
format.mobile {redirect_to :back}
|
||||||
format.js {render :nothing => true, :status => 401}
|
format.js {render :nothing => true, :status => 403}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ class MessagesController < ApplicationController
|
||||||
|
|
||||||
redirect_to conversations_path(:conversation_id => cnv.id)
|
redirect_to conversations_path(:conversation_id => cnv.id)
|
||||||
else
|
else
|
||||||
render :nothing => true, :status => 406
|
render :nothing => true, :status => 422
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
render :nothing => true, :status => 406
|
render :nothing => true, :status => 422
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class NotificationsController < ApplicationController
|
||||||
note.update_attributes(:unread => false)
|
note.update_attributes(:unread => false)
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
else
|
else
|
||||||
render :nothing => true, :code => 404
|
render :nothing => true, :status => 404
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,6 @@ class PublicsController < ApplicationController
|
||||||
@user = person.owner
|
@user = person.owner
|
||||||
Resque.enqueue(Job::ReceiveSalmon, @user.id, CGI::unescape(params[:xml]))
|
Resque.enqueue(Job::ReceiveSalmon, @user.id, CGI::unescape(params[:xml]))
|
||||||
|
|
||||||
render :nothing => true, :status => 200
|
render :nothing => true, :status => 202
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ describe CommentsController do
|
||||||
it 'does not let the user destroy comments he does not own' do
|
it 'does not let the user destroy comments he does not own' do
|
||||||
alice.should_not_receive(:retract).with(@comment2)
|
alice.should_not_receive(:retract).with(@comment2)
|
||||||
delete :destroy, :format => "js", :id => @comment3.id
|
delete :destroy, :format => "js", :id => @comment3.id
|
||||||
response.status.should == 401
|
response.status.should == 403
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ describe MessagesController do
|
||||||
end
|
end
|
||||||
it 'posts no comment' do
|
it 'posts no comment' do
|
||||||
post :create, @message_hash
|
post :create, @message_hash
|
||||||
response.code.should == '406'
|
response.code.should == '422'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue