by providing a fake
simulating different Facebook states.
If using the edge version of Jasmine with the Rails 3.1 asset pipeline:
Add the gem to your Gemfile:
gem "facebook-js-stub", :git => "git://github.com/involver/facebook-js-stub.git"
facebook-js-stub.jsasset to your
src_files: - ... - assets/facebook-js-stub.js
If you're explicitly setting helpers in your Jasmine configuration, add the new file:
helper_files: - ... - helpers/facebook-js-stub.js
FBStub is a module that provides methods for simulating a user's Facebook state and for simulating calls from
Facebook to your callbacks.
As with the official Facebook library, you need to initialize it with your Application ID before anything else. Add the
following in a
The given callback is called immediately and synchronously using the user's Facebook state as set via
The given request is recorded. The
callback is not immediately called but stored for later use.
To trigger a simulated response from Facebook, see
This simulates a logged in user.
This simulates a logged out user.
This simulates a user having authorized the current application.
This simulates a user having not authorized the current application.
This responds to a previously recorded
FB.api() request matching the given
path. It will synchronously call the
stored callback with the given
- When using
FBnamespace, so one will override the other.
Please see the included license file.