Skip to content
Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:2c077538bddfdb9c76bd secret
Created Apr 16, 2012

require 'spec_helper'
describe "/auth", :type => :api do
let(:token) { "AAACm1V7H288BAEsdcHrcsMGDmjqTKLchLIFHu2Jh0HeZA0XZBvyuyZCvOGEFr9mMp4oiMFr2Yw6Nq1leTf9FasRZBKKtXUMZD" }
it "should start off as logged out" do
response = get_json('api/v1/auth/current-user.json')
response['success'].should == false
describe "/login" do
it "should work with a valid token" do
post "api/v1/auth/login.json", :token => token
login_response = post_json 'api/v1/auth/login.json', :token => token
login_response['success'].should == true
response = get_json("api/v1/auth/current-user.json")
response['first_name'].should == 'Venkat'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.