Commit 20e0c35f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Add small improvements to constrainers and specs


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent df3c1f40fe79
......@@ -7,7 +7,7 @@
id = extract_resource_path(request.path)
if id =~ Gitlab::Regex.namespace_regex
!!Group.find_by_path(id)
Group.find_by(path: id).present?
else
false
end
......
......@@ -7,7 +7,7 @@
id = extract_resource_path(request.path)
if id =~ Gitlab::Regex.namespace_regex
!!User.find_by('lower(username) = ?', id.downcase)
User.find_by('lower(username) = ?', id.downcase).present?
else
false
end
......
......@@ -14,6 +14,6 @@
end
def request(path)
OpenStruct.new(path: path)
double(:request, path: path)
end
end
......@@ -11,6 +11,6 @@
end
def request(path)
OpenStruct.new(path: path)
double(:request, path: path)
end
end
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