Skip to content
Snippets Groups Projects
Commit 636db151 authored by Olaf Tomalka's avatar Olaf Tomalka
Browse files

Higher code quality for fork to namespace API

parent 3aa40153
No related branches found
No related tags found
No related merge requests found
Please view this file on the master branch, on stable branches it's out of date.
 
v 8.12.0 (unreleased)
- Add abillity to fork to a specific namespace using API. @ritave <olaf@tomalka.me>
- Add ability to fork to a specific namespace using API. (ritave)
- Prepend blank line to `Closes` message on merge request linked to issue (lukehowell)
- Filter tags by name !6121
- Make push events have equal vertical spacing.
Loading
Loading
Loading
Loading
@@ -204,7 +204,6 @@ module API
namespace = Namespace.find_by(id: namespace_id) || Namespace.find_by_path_or_name(namespace_id)
 
not_found!('Target Namespace') unless namespace
authorize! :create_projects, namespace
 
attrs[:namespace] = namespace
end
Loading
Loading
Loading
Loading
@@ -3,10 +3,10 @@ require 'spec_helper'
describe API::API, api: true do
include ApiHelpers
let(:user) { create(:user) }
let(:user2) { create(:user, username: 'user2_name') }
let(:user2) { create(:user) }
let(:user3) { create(:user) }
let(:admin) { create(:admin) }
let(:group) { create(:group, name: 'group_name') }
let(:group) { create(:group) }
let(:group2) do
group = create(:group, name: 'group2_name')
group.add_owner(user2)
Loading
Loading
@@ -94,7 +94,7 @@ describe API::API, api: true do
it 'fails if trying to fork to another user when not admin' do
post api("/projects/fork/#{project.id}", user2), namespace: admin.namespace.id
 
expect(response).to have_http_status(403)
expect(response).to have_http_status(409)
end
 
it 'fails if trying to fork to non-existent namespace' do
Loading
Loading
@@ -114,7 +114,7 @@ describe API::API, api: true do
it 'fails to fork to not owned group' do
post api("/projects/fork/#{project.id}", user2), namespace: group.name
 
expect(response).to have_http_status(403)
expect(response).to have_http_status(409)
end
 
it 'forks to not owned group when admin' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment