Sha256: dadff5be85833d6193efd0ec25bee18999174c8a2d9dbeefe5a94ce9808268a5

Contents?: true

Size: 1.29 KB

Versions: 15

Compression:

Stored size: 1.29 KB

Contents

RSpec.describe ChefVault::ChefApi do
  let(:root_url) { "https://localhost" }
  let(:scoped_url) { "https://localhost/organizations/fakeorg" }
  let(:api_v0_hash) { { :api_version => "0" } }
  let(:api_v1_hash) { { :api_version => "1" } }

  before do
    Chef::Config[:chef_server_root] = root_url
    Chef::Config[:chef_server_url]  = scoped_url
  end

  describe "#rest_v0" do
    it "returns an instance of Chef::ServerAPI set to use API version 0 scoped to root" do
      expect(Chef::ServerAPI).to receive(:new).with(root_url, api_v0_hash)
      subject.rest_v0
    end
  end

  describe "#rest_v1" do
    it "returns an instance of Chef::ServerAPI set to use API version 0 scoped to root" do
      expect(Chef::ServerAPI).to receive(:new).with(root_url, api_v1_hash)
      subject.rest_v1
    end
  end

  describe "#org_scoped_rest_v0" do
    it "returns an instance of Chef::ServerAPI set to use API version 0 scoped to root" do
      expect(Chef::ServerAPI).to receive(:new).with(scoped_url, api_v0_hash)
      subject.org_scoped_rest_v0
    end
  end

  describe "#org_scoped_rest_v1" do
    it "returns an instance of Chef::ServerAPI set to use API version 0 scoped to root" do
      expect(Chef::ServerAPI).to receive(:new).with(scoped_url, api_v1_hash)
      subject.org_scoped_rest_v1
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
chef-vault-3.4.0.pre.pre417 spec/chef-vault/chef_api_spec.rb
chef-vault-3.3.0 spec/chef-vault/chef_api_spec.rb
chef-vault-3.3.0.pre.pre415 spec/chef-vault/chef_api_spec.rb
chef-vault-3.3.0.pre.pre416 spec/chef-vault/chef_api_spec.rb
chef-vault-3.3.0.pre.pre414 spec/chef-vault/chef_api_spec.rb
chef-vault-3.2.0.pre.pre408 spec/chef-vault/chef_api_spec.rb
chef-vault-3.2.0.pre.pre407 spec/chef-vault/chef_api_spec.rb
chef-vault-3.2.0 spec/chef-vault/chef_api_spec.rb
chef-vault-3.1.0 spec/chef-vault/chef_api_spec.rb
chef-vault-3.0.3 spec/chef-vault/chef_api_spec.rb
chef-vault-3.0.2 spec/chef-vault/chef_api_spec.rb
chef-vault-3.0.1 spec/chef-vault/chef_api_spec.rb
chef-vault-3.0.0 spec/chef-vault/chef_api_spec.rb
chef-vault-3.0.0.rc2 spec/chef-vault/chef_api_spec.rb
chef-vault-3.0.0.rc1 spec/chef-vault/chef_api_spec.rb