Skip to content
Extraits de code Groupes Projets
Valider 1666843a rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Fix 500 in publicsController

parent ae22dcc2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -49,7 +49,7 @@ class PublicsController < ApplicationController ...@@ -49,7 +49,7 @@ class PublicsController < ApplicationController
person = Person.where(:guid => params[:guid]).first person = Person.where(:guid => params[:guid]).first
if person.owner_id.nil? if person.nil? || person.owner_id.nil?
Rails.logger.error("Received post for nonexistent person #{params[:guid]}") Rails.logger.error("Received post for nonexistent person #{params[:guid]}")
render :nothing => true, :status => 404 render :nothing => true, :status => 404
return return
......
...@@ -55,6 +55,10 @@ describe PublicsController do ...@@ -55,6 +55,10 @@ describe PublicsController do
post :receive, "guid" => @person.guid.to_s, "xml" => xml post :receive, "guid" => @person.guid.to_s, "xml" => xml
response.should be_not_found response.should be_not_found
end end
it 'returns a 404 if no person is found' do
post :receive, :guid => '2398rq3948yftn', :xml => xml
response.should be_not_found
end
end end
describe '#hcard' do describe '#hcard' do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter