Sha256: 10ed7fbc8031c58133e62c62ce350fb7e23810384fa64a07df84efe787f564ff

Contents?: true

Size: 749 Bytes

Versions: 18

Compression:

Stored size: 749 Bytes

Contents

class StubDatabase < OpenStruct
  def provisioned?
    status == 'provisioned'
  end
end

Fabricator(:database, from: :stub_database) do
  transient :service

  type 'postgresql'
  handle do |attrs|
    Fabricate.sequence(:database) { |i| "#{attrs[:type]}-#{i}" }
  end

  passphrase 'password'
  status 'provisioned'
  connection_url 'postgresql://aptible:password@10.252.1.125:49158/db'
  account
  database_image
  disk { Fabricate(:database_disk) }
  service { nil }

  backups { [] }
  database_credentials { [] }
  created_at { Time.now }

  after_create do |database, transients|
    database.account.databases << database
    database.service = transients[:service] || Fabricate(
      :service, app: nil, database: database
    )
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
aptible-cli-0.24.2 spec/fabricators/database_fabricator.rb
aptible-cli-0.24.1 spec/fabricators/database_fabricator.rb
aptible-cli-0.24.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.23.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.22.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.21.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.20.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.9 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.7 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.6 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.4 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.3 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.2 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.1 spec/fabricators/database_fabricator.rb
aptible-cli-0.19.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.18.3 spec/fabricators/database_fabricator.rb
aptible-cli-0.18.2 spec/fabricators/database_fabricator.rb
aptible-cli-0.18.1 spec/fabricators/database_fabricator.rb