Skip to content

Commit

Permalink
Add failing test for 503 Service Unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicdoe committed Nov 30, 2017
1 parent ffe7ec8 commit 021a88b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/fixtures/slack/web/503_error.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
http_interactions:
- request:
method: post
uri: https://slack.com/api/auth.test
response:
status:
code: 503
message: Service Unavailable
body:
encoding: US-ASCII
string: ''
http_version:
recorded_at: Thu, 30 Nov 2017 14:36:26 GMT
14 changes: 14 additions & 0 deletions spec/slack/web/api/errors/service_unavailable_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper'

RSpec.describe Slack::Web::Client do
let(:client) { Slack::Web::Client.new }
it 'raises a Faraday::ClientError when Slack is unavailable', vcr: { cassette_name: 'web/503_error' } do
begin
client.auth_test
raise 'Expected to receive Faraday::ClientError.'
rescue Faraday::ClientError => e
expect(e.response).to_not be_nil
expect(e.response.status).to eq 503
end
end
end

0 comments on commit 021a88b

Please sign in to comment.