test/createsend_test.rb in createsend-6.1.0 vs test/createsend_test.rb in createsend-6.1.1
- old
+ new
@@ -276,14 +276,15 @@
setup do
@cs = CreateSend::CreateSend.new @auth
@template = CreateSend::Template.new @auth, '98y2e98y289dh89h938389'
end
- { ["400", "Bad Request"] => CreateSend::BadRequest,
- ["401", "Unauthorized"] => CreateSend::Unauthorized,
- ["404", "Not Found"] => CreateSend::NotFound,
- ["418", "I'm a teapot"] => CreateSend::ClientError,
- ["500", "Server Error"] => CreateSend::ServerError
+ { ["400", "Bad Request"] => CreateSend::BadRequest,
+ ["401", "Unauthorized"] => CreateSend::Unauthorized,
+ ["404", "Not Found"] => CreateSend::NotFound,
+ ["418", "I'm a teapot"] => CreateSend::ClientError,
+ ["429", "Too many requests"] => CreateSend::TooManyRequests,
+ ["500", "Server Error"] => CreateSend::ServerError
}.each do |status, exception|
context "#{status.first}, a get" do
should "raise a #{exception.name} error" do
stub_get(@auth, "countries.json", (status.first == '400' or status.first == '401') ? 'custom_api_error.json' : nil, status)
lambda { @cs.countries }.should raise_error(exception)