Sha256: 2e3df323da469f681e374a5b6fd77d3137e45f28f43656bf6d47c0abf5e89415

Contents?: true

Size: 1.66 KB

Versions: 35

Compression:

Stored size: 1.66 KB

Contents

# fog has it's own lazy loading / autoloading thing which means we have to
# require models we want to reference in specs BEFORE we have used a Fog method
require "fog/brightbox/models/compute/account"
require "fog/brightbox/models/compute/user_collaboration"

shared_context "collaborating accounts" do
  # As returned from conn.accounts.all as an owned account
  let(:owned_account) do
    data = {
      "id" => "acc-12345",
      "resource_type" => "account",
      "url" => "https://api.gb1.brightbox.com/1.0/accounts/acc-12345",
      "name" => "Owned account name",
      "status" => "active",
      "ram_limit" => 3_200_000,
      "ram_used" => 3072,
      "cloud_ips_limit" => 32,
      "cloud_ips_used" => 0,
      "load_balancers_limit" => 5,
      "load_balancers_used" => 0
    }
    Fog::Compute::Brightbox::Account.new(data)
  end

  # As returned from conn.user_collaborations.all
  let(:active_collaboration) do
    data = {
      "id" => "col-12345",
      "resource_type" => "collaboration",
      "status" => "accepted",
      "role" => "admin",
      "account" => {
        "id" => "acc-12345",
        "name" => "Active collaboration name",
        "status" => "active"
      }
    }
    Fog::Compute::Brightbox::UserCollaboration.new(data)
  end

  # As returned from conn.user_collaborations.all
  let(:pending_collaboration) do
    data = {
      "id" => "col-12345",
      "resource_type" => "collaboration",
      "status" => "pending",
      "role" => "admin",
      "account" => {
        "id" => "acc-12345",
        "name" => "Pending collaboration name",
        "status" => "active"
      }
    }
    Fog::Compute::Brightbox::UserCollaboration.new(data)
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
brightbox-cli-2.12.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.11.2 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.11.1 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.11.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.10.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.9.3 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.9.2 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.9.1 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.9.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.8.2 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.8.1 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.8.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.7.1 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.7.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.6.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.5.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.4.1 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.4.0 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.3.4 spec/support/shared/collaborating_accounts_context.rb
brightbox-cli-2.3.3 spec/support/shared/collaborating_accounts_context.rb