Sha256: 57259b3f8de325daa2a6d5da94e66bd9cbef88c859249591fc0e300d6852b1de

Contents?: true

Size: 1.15 KB

Versions: 29

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.dev"
        }
      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

29 entries across 29 versions & 1 rubygems

Version Path
brightbox-cli-3.3.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-3.2.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-3.1.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-3.0.1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-3.0.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.12.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.11.2 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.11.1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.11.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.10.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.9.3 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.9.2 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.9.1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.9.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.8.2 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.8.1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.8.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.7.1 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.7.0 spec/unit/brightbox/bb_config/add_section_spec.rb
brightbox-cli-2.6.0 spec/unit/brightbox/bb_config/add_section_spec.rb