Skip to content

Instantly share code, notes, and snippets.

@jstirk
Created July 19, 2010 13:39
Show Gist options
  • Select an option

  • Save jstirk/481414 to your computer and use it in GitHub Desktop.

Select an option

Save jstirk/481414 to your computer and use it in GitHub Desktop.
Given /^I am logged in as a Facebook user$/ do
# Initialize facebooker session
# This will set all the parameters that FB normally passes through, as well as set up
# a default Facebooker::Mock::Session. It all just magically happens from this one liner.
@integration_session = open_session
# Now, we need to specify the default options for the request - in this case, we're setting
# that the FB UID is 1, and they have the friends defined in FACEBOOK_FRIENDS - simply UIDs separated by commas.
@integration_session.default_request_params.merge!( :fb_sig_user => 1, :fb_sig_friends => '2,3' )
# If you need to make FB requests in your steps, you can use @integration_session to make them - they
# will then go through the fixtures defined elsewhere.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment