Commit c563e29f authored by Rémy Coutable's avatar Rémy Coutable

Get rid of the user_namespace API helper method

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 8b2592ee
......@@ -67,10 +67,6 @@ module API
initial_current_user != current_user
end
def user_namespace
@user_namespace ||= find_namespace!(params[:id])
end
def user_group
@group ||= find_group!(params[:id])
end
......
......@@ -44,6 +44,8 @@ module API
requires :id, type: String, desc: "Namespace's ID or path"
end
get ':id', requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
user_namespace = find_namespace!(params[:id])
present user_namespace, with: Entities::Namespace, current_user: current_user
end
end
......
......@@ -137,18 +137,6 @@ describe API::Helpers do
it_behaves_like 'user namespace finder'
end
describe '#user_namespace' do
let(:namespace_finder) do
subject.user_namespace
end
before do
allow(subject).to receive(:params).and_return({ id: namespace.id })
end
it_behaves_like 'user namespace finder'
end
describe '#send_git_blob' do
let(:repository) { double }
let(:blob) { double(name: 'foobar') }
......
Markdown is supported
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