Sha256: 4bbf22d92db22b6e6c7b8049ea5098ef73fdc1b59cb7b4f103a0772cd284074c
Contents?: true
Size: 1.82 KB
Versions: 40
Compression:
Stored size: 1.82 KB
Contents
require "spec_helper" describe Brightbox::Config::ApiClient do let(:client_name) { "cli-12345" } let(:config) { config_from_contents(contents) } let(:config_section) { config[client_name] } subject(:section) { Brightbox::Config::ApiClient.new(config_section, client_name) } describe "#valid?" do context "when config is valid" do let(:contents) do <<-EOS [#{client_name}] api_url = http://api.brightbox.dev client_id = #{client_name} secret = #{random_token} EOS end it "is valid" do expect(section).to be_valid end end context "when config has additional values" do let(:contents) do <<-EOS [#{client_name}] api_url = http://api.brightbox.dev client_id = #{client_name} secret = #{random_token} theme = blue EOS end it "is valid" do expect(section).to be_valid end end context "when config is missing api_url" do let(:contents) do <<-EOS [#{client_name}] client_id = #{client_name} secret = #{random_token} EOS end it "is invalid" do expect(section).to_not be_valid end end context "when config is missing client_id" do let(:contents) do <<-EOS [#{client_name}] api_url = http://api.brightbox.dev secret = #{random_token} EOS end it "is invalid" do expect(section).to_not be_valid end end context "when config is missing secret" do let(:contents) do <<-EOS [#{client_name}] api_url = http://api.brightbox.dev client_id = #{client_name} EOS end it "is invalid" do expect(section).to_not be_valid end end end end
Version data entries
40 entries across 40 versions & 1 rubygems