Commit 76d981b5 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Send valid project path as name for Jira dev panel

parent 3db127f3
---
title: Send valid project path as name for Jira dev panel
merge_request:
author:
type: fixed
......@@ -11,7 +11,7 @@ module API
class Repository < Grape::Entity
expose :id
expose :namespace, as: :owner, using: Namespace
expose :name
expose :path, as: :name
end
class BranchCommit < Grape::Entity
......
......@@ -40,15 +40,17 @@ describe API::V3::Github do
describe 'GET /users/:namespace/repos' do
context 'authenticated' do
it 'returns an array of projects with github format' do
stub_licensed_features(jira_dev_panel_integration: true)
let(:group) { create(:group) }
let!(:group_project) { create(:project, group: group) }
group = create(:group)
create(:project, group: group)
before do
stub_licensed_features(jira_dev_panel_integration: true)
group.add_master(user)
get v3_api('/users/foo/repos', user)
end
it 'returns an array of projects with github format' do
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an(Array)
......@@ -56,6 +58,12 @@ describe API::V3::Github do
expect(response).to match_response_schema('entities/github/repositories')
end
it 'returns valid project path as name' do
project_names = json_response.map { |r| r['name'] }
expect(project_names).to include(project.path, group_project.path)
end
end
context 'unauthenticated' do
......
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