Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (71 sloc) 2.91 KB

ApiTaster Build Status Dependency Status

A quick and easy way to visually test out your Rails application's API.


There are already many awesome API clients (such as Postman), so why reinvent the wheel?

API Taster compared to alternatives, have the following advantages:

  • API endpoints are automatically generated from your Rails routes definition
  • Defining post params is as easy as defining routes
  • Post params can be shared with your test factories


Add API Taster in your gemfile:

gem 'api_taster', :group => :development

Mount API Taster, this will allow you to visit API Taster from within your app. For example:

Rails.application.routes.draw do
  mount ApiTaster::Engine => "/api_taster" if Rails.env.development?

Add API Taster into the autoload paths in development.rb:

config.autoload_paths += %W(

In routes.rb, define parameters for each API endpoint after the normal routes definition block. For example:

if Rails.env.development?
  ApiTaster.routes do
    get '/users'

    post '/users', {
      :user => {
        :name => 'Fred'

    get '/users/:id', {
      :id => 1

    put '/users/:id', {
      :id => 1, :user => {
        :name => 'Awesome'

    delete '/users/:id', {
      :id => 1

That's it! Enjoy! :)

Share Params with Test Factories

If you use a test factory such as FactoryGirl, you can require your test factories and share the params. For example in FactoryGirl you can use the attributes_for(:name_of_factory) method.

Obsolete / Mismatched Route Definitions Detection

APIs evolve - especially during the development stage. To keep ApiTaster.routes in sync with your route definitions, API Taster provides a warning page that shows you the definitions that are obsolete/mismatched therefore you could correct or remove them.

Use with an Engine

Rails Engines are largely self contained and separated from your main app. Therefore, to use API Taster with an Engine, you would need some extra efforts:

In your app Gemfile, you would also need:

gem "jquery-rails"
gem "bootstrap-sass"

If you are hand-picking Rails components, make sure in your application.rb you have Sprockets enabled:

require "sprockets/railtie"


This gem is released under the MIT License.


Fred Wu, originally built for Locomote.