Commit 2a916e11 authored by Samir Noir's avatar Samir Noir 🧀
Browse files

lookup_path() should return nil if a git object wasn't found for a path

parent ba8cca5b
......@@ -100,8 +100,9 @@ class ResourcesController < ApplicationController
)
raise ServerUnavailable if object.is_a?(Exception)
return nil unless object
# abasu : case logic for treating different scenarios - 11.12.2015
# case logic for treating different scenarios
case [params[:controller], params[:action]]
# 1. case of a single cluster
......@@ -124,7 +125,8 @@ class ResourcesController < ApplicationController
# Finally, set new 'total' to clusters shortlisted
object['total'] = object['items'].length
end # case [params[:controller], params[:action]]
end
object
end
......
......@@ -190,6 +190,11 @@ describe ClustersController do
expect(response.status).to eq 404
expect(response.body).to eq "Cannot find resource /sites/nancy/clusters/talc"
end # it "should return NO cluster because talc is NOT production cluster"
it "should return 404 if a resource does not exist" do
get :show, params: { :branch => 'master', :site_id => "nancy", :id => "doesnotexist", :queues => "production", :format => :json }
expect(response.status).to eq(404)
end
end # "GET /sites/{{site_id}}/clusters/{{id}}/"
# abasu : unit tests for bug ref 6363 to handle filter queues - 08.01.2016
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment