secret
Created

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
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
end
 
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'
end
end
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.