Permalink
Browse files

Merge branch 'marcgg-feature-get-page-access-token' into v1.2 (with m…

…inor tweaks)

Conflicts:
	lib/koala/graph_api.rb
  • Loading branch information...
arsduo committed Aug 4, 2011
2 parents dab0334 + d6fd230 commit 85d5e16bccde1b153f861043a7ac818f61409633
View
@@ -186,6 +186,13 @@ def search(search_terms, args = {}, options = {})
result ? GraphCollection.new(result, self) : nil # when facebook is down nil can be returned
end
end
# Page management
def get_page_access_token(page_id)
result = get_object(page_id, :fields => "access_token") do
result ? result["access_token"] : nil
end
end
# GraphCollection support
@@ -197,7 +204,6 @@ def get_page(params)
end
end
# Batch API
def batch(http_options = {}, &block)
batch_client = GraphBatchAPI.new(access_token)
@@ -420,3 +420,9 @@ graph_api:
/777777777:
no_args:
<<: *item_deleted
/my_page:
fields=access_token:
get:
<<: *token_required
with_token: '{"access_token": "<%= APP_ACCESS_TOKEN %>"}'
@@ -294,6 +294,12 @@
like_result.should be_true
end
# Page Access Token Support
it "gets a page's access token" do
# we can't test this live since test users (or random real users) can't be guaranteed to have pages to manage
@api.should_receive(:api).with("my_page", {:fields => "access_token"}, "get", anything)
@api.get_page_access_token("my_page")
end
# test all methods to make sure they pass data through to the API
# we run the tests here (rather than in the common shared example group)

0 comments on commit 85d5e16

Please sign in to comment.