Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes factories to have correct inheritance and sequencing
Browse files Browse the repository at this point in the history
d-m-u committed Jan 8, 2018

Verified

This commit was signed with the committer’s verified signature.
jsirois John Sirois
1 parent 32d6c4f commit bbcfcf6
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/factories/customization_template.rb
Original file line number Diff line number Diff line change
@@ -7,22 +7,22 @@
end
end

factory :customization_template_cloud_init do
factory :customization_template_cloud_init, :parent => :customization_template do
after(:build) do |x|
x.pxe_image_type ||= FactoryGirl.create(:pxe_image_type)
end
end

factory :customization_template_kickstart do
factory :customization_template_kickstart, :parent => :customization_template do
sequence(:name) { |n| "customization_template_kickstart_#{seq_padded_for_sorting(n)}" }
sequence(:description) { |n| "Customization Template Kickstart #{seq_padded_for_sorting(n)}" }
after(:build) do |x|
x.pxe_image_type ||= FactoryGirl.create(:pxe_image_type)
end
end

factory :customization_template_sysprep do
sequence(:name) { |n| "customization_template_syspre_#{seq_padded_for_sorting(n)}" }
factory :customization_template_sysprep, :parent => :customization_template do
sequence(:name) { |n| "customization_template_sysprep_#{seq_padded_for_sorting(n)}" }
sequence(:description) { |n| "Customization Template Sysprep #{seq_padded_for_sorting(n)}" }
after(:build) do |x|
x.pxe_image_type ||= FactoryGirl.create(:pxe_image_type)
1 change: 1 addition & 0 deletions spec/factories/pxe_image_type.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FactoryGirl.define do
factory :pxe_image_type do
sequence(:name) { |n| "pxe_image_type_#{seq_padded_for_sorting(n)}" }
end
end

0 comments on commit bbcfcf6

Please sign in to comment.