spec/unit/intercom/request_spec.rb in intercom-3.9.3 vs spec/unit/intercom/request_spec.rb in intercom-3.9.4
- old
+ new
@@ -107,9 +107,18 @@
body: 'null'
)
expect { execute! }.must_raise(Intercom::RateLimitExceeded)
end
+
+ it 'raises a GatewayTimeoutError error when the response code is 504' do
+ stub_request(:any, uri).to_return(
+ status: 504,
+ body: '<html> <head><title>504 Gateway Time-out</title></head> <body bgcolor="white"> <center><h1>504 Gateway Time-out</h1></center> </body> </html>'
+ )
+
+ expect { execute! }.must_raise(Intercom::GatewayTimeoutError)
+ end
end
describe "application error handling" do
let(:uri) {"https://api.intercom.io/conversations/reply"}
let(:req) { Intercom::Request.put(uri, {}) }