Best way of testing API Interface ruby+rspec


#1

So, going off of this post, Is there a sandbox for the Cloudflare APIs?

I’m writing a HTTParty based library that interfaces with cloudflare, as well as a cli interface that uses the library to run its actions.

So, I can run tests, but I don’t want to spam the API nor do I want to have to either myself clean up my zones etc after running tests, nor do I want to have to have other contributors have to clean theirs up. I can test objects all I want, but I can’t test endpoint responses without causing basically production-side changes, and that still spams the API even if I make meaningless or never-used zones.


#2

Hi IotaSpencer,

I have updated that question with the results of my inquiry via filing a ticket. The short answer is that no such ability exists.

It sounds like your testing is less unit-testing an more like grok-testing. A sandbox would be great for both cases, if it existed. I don’t have any suggestions beyond the reply I got to “have a spare domain” - but that doesn’t really solve the cleanup problem.