2020-04-22 19:07:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :terraform_state, class: 'Terraform::State' do
|
|
|
|
project { create(:project) }
|
|
|
|
|
|
|
|
sequence(:name) { |n| "state-#{n}" }
|
|
|
|
|
|
|
|
trait :with_file do
|
|
|
|
file { fixture_file_upload('spec/fixtures/terraform/terraform.tfstate', 'application/json') }
|
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
trait :locked do
|
|
|
|
sequence(:lock_xid) { |n| "lock-#{n}" }
|
|
|
|
locked_at { Time.current }
|
|
|
|
locked_by_user { create(:user) }
|
|
|
|
end
|
2020-04-22 19:07:51 +05:30
|
|
|
end
|
|
|
|
end
|