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