Sha256: 764c5aa7e59d4bf47237dface19e937f3a0b39323282069ea46136ebe05fe082
Contents?: true
Size: 1.63 KB
Versions: 14
Compression:
Stored size: 1.63 KB
Contents
require "spec_helper" describe Brightbox::Config::UserApplication do let(:client_name) { "app-12345" } let(:config) { config_from_contents(contents) } let(:config_section) { config[client_name] } subject(:section) { Brightbox::Config::UserApplication.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.localhost username = user@example.com 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.localhost client_id = #{client_name} secret = #{random_token} username = user@example.com 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} username = user@example.com EOS end it "is invalid" do expect(section).to_not be_valid end end context "when config is missing username" do let(:contents) do <<-EOS [#{client_name}] api_url = http://api.brightbox.localhost client_id = #{client_name} secret = #{random_token} EOS end it "is invalid" do expect(section).to_not be_valid end end end end
Version data entries
14 entries across 14 versions & 1 rubygems