Sha256: c600f1ec9315eb01c0fd9fcc286112b2ea77aba500d9de9c3b54b6bfe1ff4706

Contents?: true

Size: 1.15 KB

Versions: 18

Compression:

Stored size: 1.15 KB

Contents

require "spec_helper"

describe Brightbox::BBConfig do
  describe "#add_section" do
    context "when first and only client", vcr: true do
      let(:config) { Brightbox::BBConfig.new }
      let(:client_alias) { "dev" }
      let(:client_id) { "app-12345" }
      let(:secret) { "mocbuipbiaa6k6c" }
      let(:account_id) { "acc-12345" }
      let(:options) do
        {
          :username => "jason.null@brightbox.com",
          :api_url => "http://api.brightbox.localhost"
        }
      end
      let(:saved_config) { config_file_contents }

      before do
        remove_config
        mock_password_entry

        FauxIO.new do
          config.add_section(client_alias, client_id, secret, options)
        end
      end

      it "saves changes to the config file" do
        expect(saved_config).to match("client_id = #{client_id}")
      end

      it "requests tokens for the new client"

      it "saves the default account" do
        expect(saved_config).to match("default_account = #{account_id}")
      end

      it "saves the new client as the default" do
        expect(saved_config).to match("default_client = #{client_alias}")
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/bb_config/add_section_spec.rb