diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-10 15:06:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-10 15:06:07 +0000 |
commit | d96abbee0b394ac40eb67253214fb9c41a31bd41 (patch) | |
tree | 4887c6f08cc902c79e2a31d21a85ce7909cf88bc /spec/lib | |
parent | 69849c280c5525d132ebaddb1200c390a42ecc06 (diff) | |
download | gitlab-ce-d96abbee0b394ac40eb67253214fb9c41a31bd41.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/github_import/importer/releases_importer_spec.rb | 16 | ||||
-rw-r--r-- | spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb b/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb index a1585fd2eb3..6a31c57a73d 100644 --- a/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb @@ -34,6 +34,22 @@ describe Gitlab::GithubImport::Importer::ReleasesImporter do importer.execute end + + it 'imports draft releases' do + release_double = double( + name: 'Test', + body: 'This is description', + tag_name: '1.0', + description: 'This is my release', + created_at: created_at, + updated_at: created_at, + published_at: nil + ) + + expect(importer).to receive(:each_release).and_return([release_double]) + + expect { importer.execute }.to change { Release.count }.by(1) + end end describe '#build_releases' do diff --git a/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb index 2cf4b367c0b..554be57fbec 100644 --- a/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb @@ -37,6 +37,14 @@ describe Gitlab::LegacyGithubImport::ReleaseFormatter do expect(release.attributes).to eq(expected) end + + context 'with a nil published_at date' do + let(:published_at) { nil } + + it 'inserts a timestamp for released_at' do + expect(release.attributes[:released_at]).to be_a(Time) + end + end end describe '#valid' do |