Commit 9d89dffb authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '221259-improve-package-factories' into 'master'

Improve package factories

See merge request gitlab-org/gitlab!35128
parents 02793e19 41d00edd
......@@ -118,14 +118,25 @@ FactoryBot.define do
end
factory :composer_metadatum, class: 'Packages::Composer::Metadatum' do
package { create(:composer_package) }
target_sha { '123' }
composer_json { { name: 'foo' } }
end
factory :package_build_info, class: 'Packages::BuildInfo' do
package
end
factory :package_file, class: 'Packages::PackageFile' do
package
file { fixture_file_upload('spec/fixtures/packages/conan/recipe_files/conanfile.py') }
file_name { 'conanfile.py' }
file_sha1 { 'be93151dc23ac34a82752444556fe79b32c7a1ad' }
file_md5 { '12345abcde' }
size { 400.kilobytes }
factory :conan_package_file do
package { create(:conan_package, without_package_files: true) }
......@@ -297,6 +308,7 @@ FactoryBot.define do
factory :conan_file_metadatum, class: 'Packages::Conan::FileMetadatum' do
package_file { create(:conan_package_file, :conan_recipe_file, without_loaded_metadatum: true) }
recipe_revision { '0' }
conan_file_type { 'recipe_file' }
trait(:recipe_file) do
conan_file_type { 'recipe_file' }
......@@ -316,7 +328,7 @@ FactoryBot.define do
end
factory :packages_dependency_link, class: 'Packages::DependencyLink' do
package
package { create(:nuget_package) }
dependency { create(:packages_dependency) }
dependency_type { :dependencies }
......@@ -328,6 +340,7 @@ FactoryBot.define do
end
factory :nuget_dependency_link_metadatum, class: 'Packages::Nuget::DependencyLinkMetadatum' do
dependency_link { create(:packages_dependency_link) }
target_framework { '.NETStandard2.0' }
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