Created
March 1, 2012 09:48
-
-
Save stravid/1948609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Slotcars::Application.routes.draw do | |
root :to => 'tracks#index' | |
get '/tracks/:id' => 'tracks#index' | |
get '/tracks/new' => 'tracks#index' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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