Permalink
Browse files

Add correction to be the pull request

* Specify which access token to use with debug_token
* Try to make the tests compliant with live testing
  • Loading branch information...
Cyril Fluck Cyril Fluck
Cyril Fluck authored and Cyril Fluck committed Dec 11, 2012
1 parent b05de66 commit 80ac1cc5695f6aca47c912eeb1b8871b6e529eaa
@@ -369,6 +369,8 @@ def get_page_access_token(id, args = {}, options = {}, &block)
end
# Get an access token information
+ # The access token used to instantiate the API object needs to be
+ # the app access token or a valid User Access Token from a developer of the app.
# See https://developers.facebook.com/docs/howtos/login/debugging-access-tokens/#step1
#
# @param input_token the access token you want to inspect
@@ -309,7 +309,7 @@ graph_api:
with_token: "true"
/debug_token:
- input_token=this_is_an_access_token:
+ input_token=<%= APP_ACCESS_TOKEN %>:
get:
with_token: '{ "data": { "app_id": 138483919580948, "application": "Social Cafe", "expires_at": 1352419328, "is_valid": true, "issued_at": 1347235328, "metadata": { "sso": "iphone-safari" }, "scopes": [ "email", "publish_actions" ], "user_id": 1207059 } }'
@@ -413,24 +413,11 @@
end
it "can get information about an access token" do
- result = @api.debug_token("this_is_an_access_token")
- result.should == {
- "data" => {
- "app_id" => 138483919580948,
- "application" => "Social Cafe",
- "expires_at" => 1352419328,
- "is_valid" => true,
- "issued_at" => 1347235328,
- "metadata" => {
- "sso" => "iphone-safari"
- },
- "scopes" => [
- "email",
- "publish_actions"
- ],
- "user_id" => 1207059
- }
- }
+ result = @api.debug_token(KoalaTest.app_access_token)
+ result.should be_kind_of(Hash)
+ result["data"].should be_kind_of(Hash)
+ result["data"]["app_id"].should == 138483919580948
+ result["data"]["application"].should == "Social Cafe"
end
describe "#set_app_restrictions" do

0 comments on commit 80ac1cc

Please sign in to comment.