Find file History
Pull request Compare This branch is 367 commits behind zipmark:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
step_definitions
support
callbacks.feature
combined_json.feature
combined_text.feature
example_request.feature
headers.feature
html_documentation.feature
json_iodocs.feature
oauth2_mac_client.feature
readme.md

readme.md

Travis status Gemnasium status

http://github.com/zipmark/rspec_api_documentation

RSpec API Doc Generator

Generate pretty API docs for your Rails APIs.

Installation

Add rspec_api_documentation to your Gemfile

gem 'rspec_api_documentation'

Bundle it!

$> bundle install

Require it in your API tests

require "rspec_api_documentation"
require "rspec_api_documentation/dsl"

See the wiki for additional setup. Setting up RSpec API Documentation

Usage

resource "Account" do
  get "/accounts" do
    example "Get a list of all accounts" do
      do_request
      last_response.status.should be_ok
    end
  end

  get "/accounts/:id" do
    parameter :id, "Account ID"

    let(:account) { Factory(:account) }
    let(:id) { account.id }

    example "Get an account", :document => :public do
      do_request
      last_response.status.should be_ok
    end
  end
end