I am using the gem fb_graph. I am new to rails, and am trying to figure out how to mock this gem using rspec. ( https://github.com/nov/fb_graph )
The code I am attempting to test is:
facebook_user = FbGraph::User.new('me', :access_token => access_token['credentials']['token']).fetch
return facebook_user.friends
I was thinking something along the following lines:
fb_graph = mock(FbGraph)
user = mock(FbGraph::User)
fb_graph.should_receive(:new).should_return(user)
user.should_receive(:fetch).should_return(fb_graph_user)
user.should_receive(:friends)
Thanks!