Commit 848f4980 authored by James Lopez's avatar James Lopez

add entity and update spec

parent de3edb71
...@@ -138,6 +138,7 @@ module API ...@@ -138,6 +138,7 @@ module API
mount ::API::PagesDomains mount ::API::PagesDomains
mount ::API::Pipelines mount ::API::Pipelines
mount ::API::PipelineSchedules mount ::API::PipelineSchedules
mount ::API::ProjectImport
mount ::API::ProjectHooks mount ::API::ProjectHooks
mount ::API::Projects mount ::API::Projects
mount ::API::ProjectMilestones mount ::API::ProjectMilestones
......
...@@ -90,6 +90,11 @@ module API ...@@ -90,6 +90,11 @@ module API
expose :created_at expose :created_at
end end
class ProjectImportStatus < ProjectIdentity
expose :import_status
expose :import_error, if: :import_error
end
class BasicProjectDetails < ProjectIdentity class BasicProjectDetails < ProjectIdentity
include ::API::ProjectsRelationBuilder include ::API::ProjectsRelationBuilder
......
...@@ -33,7 +33,7 @@ describe API::ProjectImport do ...@@ -33,7 +33,7 @@ describe API::ProjectImport do
get api("/projects/#{project.id}/import", user) get api("/projects/#{project.id}/import", user)
expect(response).to have_gitlab_http_status(200) 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 end
it 'returns the import status and the error if failed' do it 'returns the import status and the error if failed' do
...@@ -42,7 +42,7 @@ describe API::ProjectImport do ...@@ -42,7 +42,7 @@ describe API::ProjectImport do
get api("/projects/#{project.id}/import", user) get api("/projects/#{project.id}/import", user)
expect(response).to have_gitlab_http_status(200) 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') 'import_error' => 'error')
end end
end end
......
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