Add a field for released_at to GH importer

This commit is contained in:
Cindy Pallares 🦉 2019-08-09 00:06:21 +00:00 committed by Mayra Cabrera
parent 136c3efe61
commit 2b30423935
3 changed files with 11 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
title: Add a field for released_at to GH importer
merge_request: 31496
author:
type: fixed

View file

@ -36,6 +36,7 @@ module Gitlab
description: description_for(release),
created_at: release.created_at,
updated_at: release.updated_at,
released_at: release.published_at,
project_id: project.id
}
end

View file

@ -6,6 +6,7 @@ describe Gitlab::GithubImport::Importer::ReleasesImporter do
let(:importer) { described_class.new(project, client) }
let(:created_at) { Time.new(2017, 1, 1, 12, 00) }
let(:updated_at) { Time.new(2017, 1, 1, 12, 15) }
let(:released_at) { Time.new(2017, 1, 1, 12, 00) }
let(:release) do
double(
@ -13,7 +14,8 @@ describe Gitlab::GithubImport::Importer::ReleasesImporter do
tag_name: '1.0',
body: 'This is my release',
created_at: created_at,
updated_at: updated_at
updated_at: updated_at,
published_at: released_at
)
end
@ -23,7 +25,8 @@ describe Gitlab::GithubImport::Importer::ReleasesImporter do
tag_name: '1.0',
description: 'This is my release',
created_at: created_at,
updated_at: updated_at
updated_at: updated_at,
released_at: released_at
}
expect(importer).to receive(:build_releases).and_return([release_hash])