diff options
author | Diana Stanley <dstanley@gitlab.com> | 2019-02-26 16:57:01 -0800 |
---|---|---|
committer | Diana Stanley <dstanley@gitlab.com> | 2019-02-26 16:57:01 -0800 |
commit | 46da2764ce37dc0fb43b86460fd98a5af330c434 (patch) | |
tree | 61ab41ef4457c4a5d5418317c67c9390ed865ad7 /spec/lib | |
parent | 63b89f0485ea8ba3594b4858e3e5883f3bbab201 (diff) | |
download | gitlab-ce-46da2764ce37dc0fb43b86460fd98a5af330c434.tar.gz |
Add test for nil due_on value during import
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb b/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb index 471f499dd19..35c37f9499d 100644 --- a/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb @@ -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) |