diff options
Diffstat (limited to 'spec/factories/packages/dependency_links.rb')
-rw-r--r-- | spec/factories/packages/dependency_links.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/factories/packages/dependency_links.rb b/spec/factories/packages/dependency_links.rb new file mode 100644 index 00000000000..6470cbdc9a6 --- /dev/null +++ b/spec/factories/packages/dependency_links.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :packages_dependency_link, class: 'Packages::DependencyLink' do + package { association(:nuget_package) } + dependency { association(:packages_dependency) } + dependency_type { :dependencies } + + trait(:with_nuget_metadatum) do + after :build do |link| + link.nuget_metadatum = build(:nuget_dependency_link_metadatum) + end + end + + trait(:rubygems) do + package { association(:rubygems_package) } + dependency { association(:packages_dependency, :rubygems) } + end + end +end |