-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add failing test for 503 Service Unavailable
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |