Skip to content

Instantly share code, notes, and snippets.

@gbelote
Created July 18, 2012 20:37
Show Gist options
  • Save gbelote/3138729 to your computer and use it in GitHub Desktop.
Save gbelote/3138729 to your computer and use it in GitHub Desktop.
diff --git a/spec/lib/facebook/graph_api_spec.rb b/spec/lib/facebook/graph_api_spec.rb
index 7cbbc2c..cafcab9 100644
--- a/spec/lib/facebook/graph_api_spec.rb
+++ b/spec/lib/facebook/graph_api_spec.rb
@@ -19,4 +19,18 @@ describe Facebook::GraphApi do
page_name.should == 'LaunchWare Inc.'
end
+ context "#token_can_post?" do
+ # magic happens in VCR...
+ let(:page_id) { "12345" }
+ let(:good_token) { "good_token" }
+ let(:bad_token) { "bad_token" }
+
+ it "should allow valid tokens to post" do
+ Facebook::GraphApi.token_can_post?(good_token, page_id).should be_true
+ end
+ it "should not allow invalid tokens to post" do
+ Facebook::GraphApi.token_can_post?(bad_token, page_id).should be_false
+ end
+ end
+
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment