-
Notifications
You must be signed in to change notification settings - Fork 464
Testing
Koala’s has full test coverage for both the GraphAPI class (with and without an access token) and the OAuth class.
The tests are written in RSpec and can be run by calling
spec koala_tests.rb
from the test directory. (I hear it’s proper form to include a Rake task that runs the tests. Stay tuned.)
Since we’re using the Facebook API, we have to play by the rules of the Facebook API. Unfortunately, that means using information that sometimes expires. Koala provides as much information as it can for testing OAuth parsing and validation, but for the Graph API and for OAuth token retrieval, you’ll have to supply your own information. (Let me know if you can think of a way around this.)
When you run the tests with an access token, the put_object tests will create and then immediately delete several wall posts on your own wall. As Koala cleans up after itself, it also outputs (via puts) the IDs of each node created, in case anything goes wrong.