Skip to content

Instantly share code, notes, and snippets.

@stravid
Created March 1, 2012 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stravid/1948609 to your computer and use it in GitHub Desktop.
Save stravid/1948609 to your computer and use it in GitHub Desktop.
Slotcars::Application.routes.draw do
root :to => 'tracks#index'
get '/tracks/:id' => 'tracks#index'
get '/tracks/new' => 'tracks#index'
end
require 'spec_helper'
describe Api::TracksController do
let(:tracks) { FactoryGirl.create_list(:track, 10) }
describe '#index' do
it 'should respond with all tracks as JSON' do
json_tracks = tracks.to_json
get :index
response.body.should == json_tracks
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment