Skip to content

Instantly share code, notes, and snippets.

@jasonm
Created October 24, 2009 03:34
Show Gist options
  • Save jasonm/217342 to your computer and use it in GitHub Desktop.
Save jasonm/217342 to your computer and use it in GitHub Desktop.
# pasted for a comment on http://bkocik.net/2009/05/07/testing-twitter-oauth-with-cucumber-webrat-and-fakeweb/
Given /^I am signed in as "@(.*)"$/ do |twitter_username|
@twitter_username = twitter_username # used inside #fixture_file by #stub_:method - see http://gist.github.com/125281
stub_post('https://twitter.com/oauth/request_token', 'access_token')
stub_post('https://twitter.com/oauth/access_token', 'access_token')
stub_get('https://twitter.com/account/verify_credentials.json', 'verify_credentials.json')
visit path_to('the login page')
visit path_to('the oauth callback page')
end
# from features/support/paths.rb
when /the oauth callback page/
oauth_callback_path
when /the login page/
login_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment