add entity and update spec

This commit is contained in:
James Lopez 2018-02-12 12:40:55 +01:00
parent de3edb7178
commit 848f49801d
No known key found for this signature in database
GPG Key ID: 756BF8E9D7C0CF39
3 changed files with 8 additions and 2 deletions

View File

@ -138,6 +138,7 @@ module API
mount ::API::PagesDomains
mount ::API::Pipelines
mount ::API::PipelineSchedules
mount ::API::ProjectImport
mount ::API::ProjectHooks
mount ::API::Projects
mount ::API::ProjectMilestones

View File

@ -90,6 +90,11 @@ module API
expose :created_at
end
class ProjectImportStatus < ProjectIdentity
expose :import_status
expose :import_error, if: :import_error
end
class BasicProjectDetails < ProjectIdentity
include ::API::ProjectsRelationBuilder

View File

@ -33,7 +33,7 @@ describe API::ProjectImport do
get api("/projects/#{project.id}/import", user)
expect(response).to have_gitlab_http_status(200)
expect(json_response).to eq('import_status' => 'started')
expect(json_response).to include('import_status' => 'started')
end
it 'returns the import status and the error if failed' do
@ -42,7 +42,7 @@ describe API::ProjectImport do
get api("/projects/#{project.id}/import", user)
expect(response).to have_gitlab_http_status(200)
expect(json_response).to eq('import_status' => 'failed',
expect(json_response).to include('import_status' => 'failed',
'import_error' => 'error')
end
end