Sha256: 7cf8ac977e88211cc4ce87214dc6830a565887f8e3d139cd40b432cb89d72777

Contents?: true

Size: 752 Bytes

Versions: 5

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Cloudflare::Accounts, order: :defined, timeout: 30 do
	include_context Cloudflare::Account

	before do
		account.id # Force a fetch if it hasn't happened yet
	end

	it 'can list existing accounts' do
		accounts = connection.accounts.to_a
		expect(accounts.any? {|a| a.id == account.id }).to be true
	end

	it 'can get a specific account' do
		expect(connection.accounts.find_by_id(account.id).id).to eq account.id
	end

	it 'can generate a representation for the KV namespace endpoint' do
		ns = connection.accounts.find_by_id(account.id).kv_namespaces
		expect(ns).to be_kind_of(Cloudflare::KV::Namespaces)
		expect(ns.resource.reference.path).to end_with("/#{account.id}/storage/kv/namespaces")
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cloudflare-4.2.0 spec/cloudflare/accounts_spec.rb
cloudflare-4.1.3 spec/cloudflare/accounts_spec.rb
cloudflare-4.1.2 spec/cloudflare/accounts_spec.rb
cloudflare-4.1.1 spec/cloudflare/accounts_spec.rb
cloudflare-4.1.0 spec/cloudflare/accounts_spec.rb