-
-
Save anonymous/2c077538bddfdb9c76bd 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment