Sha256: b3c2dc611d00f6ddf52fa93f5e8747447712f0079651bf0b792a6bb268177efe

Contents?: true

Size: 844 Bytes

Versions: 13

Compression:

Stored size: 844 Bytes

Contents

require 'spec_helper'

RSpec.describe Slack::Web::Api::Endpoints::Auth do
  let(:client) { Slack::Web::Client.new }
  context 'without auth', vcr: { cassette_name: 'web/auth_test_error' } do
    it 'fails with an exception' do
      expect { client.auth_test }.to raise_error Slack::Web::Api::Errors::SlackError, 'not_authed'
    end
  end
  context 'with auth', vcr: { cassette_name: 'web/auth_test_success' } do
    it 'succeeds' do
      expect { client.auth_test }.to_not raise_error
    end
  end
  context '429 error', vcr: { cassette_name: 'web/429_error' } do
    it 'fails with an specific exception' do
      begin
        client.auth_test
      rescue Slack::Web::Api::Errors::TooManyRequestsError => e
        expect(e.message).to eq('Retry after 3600 seconds')
        expect(e.retry_after).to eq(3600)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
slack-ruby-client-0.14.4 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.14.3 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.14.2 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.14.1 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.14.0 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.13.1 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.13.0 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.12.0 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.11.1 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.11.0 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.10.0 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.9.1 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
slack-ruby-client-0.9.0 spec/slack/web/api/endpoints/custom_specs/auth_spec.rb