Add test for nil due_on value during import

This commit is contained in:
Diana Stanley 2019-02-26 16:57:01 -08:00
parent 63b89f0485
commit 46da2764ce
1 changed files with 21 additions and 0 deletions

View File

@ -21,6 +21,19 @@ describe Gitlab::GithubImport::Importer::MilestonesImporter, :clean_gitlab_redis
)
end
let(:milestone2) do
double(
:milestone,
number: 1,
title: '1.0',
description: 'The first release',
state: 'open',
due_on: nil,
created_at: created_at,
updated_at: updated_at
)
end
describe '#execute' do
it 'imports the milestones in bulk' do
milestone_hash = { number: 1, title: '1.0' }
@ -114,6 +127,14 @@ describe Gitlab::GithubImport::Importer::MilestonesImporter, :clean_gitlab_redis
end
end
describe '#nil_due_on' do
let(:milestone_hash) { importer.build(milestone2) }
it 'should handle missing due_on correctly' do
expect(milestone_hash[:due_date]).to be nil
end
end
describe '#each_milestone' do
it 'returns the milestones' do
expect(client)