Skip to content

WorldModule::API

jfinkhaeuser edited this page Dec 17, 2014 · 2 revisions

WorldModule::API

The API module provides simpler functionality for testing of web APIs.

The module makes two functions available:

  • has_api? returns true if an API client instance is up and running.
  • api returns a faraday client instance, slightly enhanced to provide for slightly easier setup.

Usage

Given(/I do foo/) do
  api.set_conn("http://my/api/endpoint") # works with XML and JSON APIs.
  api.get "/some/relative/url.json"
end