Fendo
Fendo

Reputation: 339

How do I write tests for facebook graph api in my rails app?

I'm using rails 3 and experimenting with the facebook graph api. I'm trying to do things in a TDD/BDD way but I'm not sure how to test my calls to the api. Do I simply wrap the facebook api methods into stubs and return mock objects?

Upvotes: 3

Views: 449

Answers (2)

ryan
ryan

Reputation: 2945

i've recently released a utility to help with this. it's a standalone implementation of Facebook's FQL and Graph API that you can run on your development machine.

http://code.google.com/p/mockfacebook/

Upvotes: 0

Josh Deeden
Josh Deeden

Reputation: 1690

I'm actually faced with a similar problem. I'm looking at https://github.com/mislav/fakeweb as a way of mocking out http responses. Haven't used it for real yet, but based on my preliminary experiments I think it'll work for my purposes. Maybe it'll work for yours too.

Upvotes: 1

Related Questions