Sha256: a086a84d4a143775da37f14d8b0b370e0af2e48efa43b323ba5e38a084c113ce

Contents?: true

Size: 669 Bytes

Versions: 16

Compression:

Stored size: 669 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
  service { nil }

  backups { [] }
  database_credentials { [] }

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aptible-cli-0.17.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.9 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.8 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.7 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.6 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.5 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.4 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.3 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.2 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.1 spec/fabricators/database_fabricator.rb
aptible-cli-0.16.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.15.2 spec/fabricators/database_fabricator.rb
aptible-cli-0.15.1 spec/fabricators/database_fabricator.rb
aptible-cli-0.15.0 spec/fabricators/database_fabricator.rb
aptible-cli-0.14.1 spec/fabricators/database_fabricator.rb
aptible-cli-0.14.0 spec/fabricators/database_fabricator.rb