Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider c94bac3c rédigé par Steffen van Bergerem's avatar Steffen van Bergerem
Parcourir les fichiers

Return 406 instead of 500 for statistics.json

Fixes #7406
parent 9a76cf7d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,6 +13,9 @@ class NodeInfoController < ApplicationController ...@@ -13,6 +13,9 @@ class NodeInfoController < ApplicationController
end end
def statistics def statistics
@statistics = NodeInfoPresenter.new("1.0") respond_to do |format|
format.json { head :not_acceptable }
format.all { @statistics = NodeInfoPresenter.new("1.0") }
end
end end
end end
...@@ -51,6 +51,11 @@ describe NodeInfoController do ...@@ -51,6 +51,11 @@ describe NodeInfoController do
end end
describe "#statistics" do describe "#statistics" do
it "returns a 406 for json format" do
get :statistics, format: "json"
expect(response.code).to eq("406")
end
it "responds to html" do it "responds to html" do
get :statistics, format: "html" get :statistics, format: "html"
expect(response.code).to eq("200") expect(response.code).to eq("200")
......
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