2020-03-27 08:07:43 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :terraform_state, class: 'Terraform::State' do
|
|
|
|
project { create(:project) }
|
|
|
|
|
2020-04-21 11:21:10 -04:00
|
|
|
sequence(:name) { |n| "state-#{n}" }
|
|
|
|
|
2020-03-27 08:07:43 -04:00
|
|
|
trait :with_file do
|
2020-04-21 11:21:10 -04:00
|
|
|
file { fixture_file_upload('spec/fixtures/terraform/terraform.tfstate', 'application/json') }
|
2020-03-27 08:07:43 -04:00
|
|
|
end
|
2020-07-14 02:09:17 -04:00
|
|
|
|
|
|
|
trait :locked do
|
|
|
|
sequence(:lock_xid) { |n| "lock-#{n}" }
|
|
|
|
locked_at { Time.current }
|
|
|
|
locked_by_user { create(:user) }
|
|
|
|
end
|
2020-03-27 08:07:43 -04:00
|
|
|
end
|
|
|
|
end
|