Sha256: 6e56240065b696373b84722009a32a1387e0247c422ccbc22dbfa02cf650f5d9

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

RSpec.describe Applicaster::Accounts::Configuration do
  let(:config) { described_class.new }

  specify "defaults" do
    expect(config.attributes).to eq({
      base_url: "https://accounts.applicaster.com/",
      client_id: nil,
      client_secret: nil,
      retries: 2,
      timeout: 1.0,
      faraday_adapter: :excon,
    })
  end

  describe "#base_url" do
    it "defaults to env var ACCOUNTS_BASE_URL" do
      base_url = "http://example.com"

      with_env_var("ACCOUNTS_BASE_URL", base_url) do
        expect(config.base_url).to eq(base_url)
      end
    end
  end

  describe "#client_id" do
    it "defaults to env var ACCOUNTS_CLIENT_ID" do
      with_env_var("ACCOUNTS_CLIENT_ID", "test-client-id") do
        expect(config.client_id).to eq("test-client-id")
      end
    end
  end

  describe "#client_secret" do
    it "defaults to env var ACCOUNTS_CLIENT_SECRET" do
      with_env_var("ACCOUNTS_CLIENT_SECRET", "test-client-secret") do
        expect(config.client_secret).to eq("test-client-secret")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
omniauth-applicaster-2.0.0 spec/lib/applicaster/accounts/configuration_spec.rb
omniauth-applicaster-1.9.0 spec/lib/applicaster/accounts/configuration_spec.rb
omniauth-applicaster-1.8.0 spec/lib/applicaster/accounts/configuration_spec.rb
omniauth-applicaster-1.7.1 spec/lib/applicaster/accounts/configuration_spec.rb
omniauth-applicaster-1.7.0 spec/lib/applicaster/accounts/configuration_spec.rb