Sha256: f59b91736d552680430438fd29ceceb60d1dff494f76bd350b96bfbba4d5d856
Contents?: true
Size: 1.08 KB
Versions: 37
Compression:
Stored size: 1.08 KB
Contents
shared_examples_for "a webhook" do |verb| it "should #{verb} to the given uri" do request = stub_request(verb, "www.example.com") Expressive.run("(#{verb} \"http://www.example.com\")") assert_requested(request) end it "should add an entry in the errors element of the scope" do message = 'Something went Pete Tong' exception = RestClient::Exception.new exception.message = message stub_request(verb, 'www.example.com').to_raise(exception) Expressive.run("(#{verb} \"http://www.example.com\")", @scope) @scope['_errors'].should eql message end it "should add an entry in the errors element of the scope" do stub_request(verb, "badexample.com").to_raise(RestClient::ResourceNotFound.new) Expressive.run("(#{verb} \"badexample.com\")", @scope) @scope['_errors'].should eql 'Resource Not Found' end it "should add an entry in the errors element of the scope" do stub_request(verb, 'www.example.com').to_timeout Expressive.run("(#{verb} \"http://www.example.com\")", @scope) @scope['_errors'].should eql 'Request Timeout' end end
Version data entries
37 entries across 37 versions & 1 rubygems