What's the best way to generate a post request to test an API. Sadly, this won't work since there is no form to submit: create a post request using poltergeist and capybara
Post via Capybara and Poltergiest for API testing
679 views Asked by Nathan At
2
There are 2 answers
0
On
If you're testing an API there's no need for Poltergeist.
Poltergeist is useful for testing web pages with Javascript on them without a browser so it can run headless.
We use the Faraday gem to generate all the RESTful calls, GET, POST and etc to an API. But Httparty is just as good, or even bare net/http
Never mind, just added a post method to the poltergiest driver:
https://github.com/nathantsoi/poltergeist
use it with:
Gemfile:
Tests: