Sha256: d1b8e82206e491a5aea4bc5aed0512e1a5841a76158285ffb13179ddf9be57a2

Contents?: true

Size: 865 Bytes

Versions: 8

Compression:

Stored size: 865 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

RSpec.describe Slack::Events::Config do
  before do
    ENV['SLACK_SIGNING_SECRET'] = 'secret'
    described_class.reset
  end

  after do
    ENV.delete 'SLACK_SIGNING_SECRET'
  end

  it 'defaults signing secret to ENV[SLACK_SIGNING_SECRET]' do
    expect(Slack::Events.config.signing_secret).to eq 'secret'
  end
  it 'defaults signature expiration to 5 minutes' do
    expect(Slack::Events.config.signature_expires_in).to eq 5 * 60
  end
  context 'configured' do
    before do
      Slack::Events.configure do |config|
        config.signing_secret = 'custom'
        config.signature_expires_in = 45
      end
    end

    it 'uses the configured values' do
      expect(Slack::Events.config.signing_secret).to eq 'custom'
      expect(Slack::Events.config.signature_expires_in).to eq 45
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
slack-ruby-client-1.1.0 spec/slack/events/config_spec.rb
slack-ruby-client-1.0.0 spec/slack/events/config_spec.rb
slack-ruby-client-0.17.0 spec/slack/events/config_spec.rb
slack-ruby-client-0.16.0 spec/slack/events/config_spec.rb
slack-ruby-client-0.15.1 spec/slack/events/config_spec.rb
slack-ruby-client-0.15.0 spec/slack/events/config_spec.rb
slack-ruby-client-0.14.6 spec/slack/events/config_spec.rb
slack-ruby-client-0.14.5 spec/slack/events/config_spec.rb