Created
December 3, 2010 20:59
-
-
Save mchung/727548 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FakewebHelpers | |
# Make sure nothing gets out (IMPORTANT) | |
FakeWeb.allow_net_connect = false | |
# Turns a fixture file name into a full path | |
def fixture_file(filename) | |
return '' if filename == '' | |
File.expand_path(Rails.root.to_s + '/features/fixtures/' + filename) | |
end | |
# Convenience methods for stubbing URLs to fixtures | |
def stub_get(url, filename) | |
FakeWeb.register_uri(:get, url, :response => fixture_file(filename)) | |
end | |
def stub_post(url, filename) | |
FakeWeb.register_uri(:post, url, :response => fixture_file(filename)) | |
end | |
def stub_any(url, filename) | |
FakeWeb.register_uri(:any, url, :response => fixture_file(filename)) | |
end | |
end | |
World(FakewebHelpers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP/1.1 200 OK | |
oauth_token=8ld9IZyxQeVrFZXFDOZH5tAwj6vzJYuLQpl0WUEYtWXc&oauth_token_secret=x6qpRnlEmW9zJbQn4PQVVeVG8KZLPEx6A0TOebgwcuA&oauth_callback_confirmed=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP/1.1 200 OK | |
{ | |
"profile_sidebar_fill_color": "0e1621", | |
"profile_background_tile": false, | |
"name": "Marc Chung", | |
"profile_sidebar_border_color": "454b52", | |
"profile_image_url": "http:\/\/a3.twimg.com\/profile_images\/768477835\/me-linkedin-30a16c5_normal.jpg", | |
"location": "Arizona", | |
"created_at": "Wed Aug 20 04:23:31 +0000 2008", | |
"id_str": "15913931", | |
"profile_link_color": "cb9934", | |
"follow_request_sent": false, | |
"contributors_enabled": false, | |
"url": "http:\/\/marcchung.com", | |
"favourites_count": 285, | |
"utc_offset": -25200, | |
"id": 15913931, | |
"profile_use_background_image": true, | |
"listed_count": 84, | |
"followers_count": 799, | |
"protected": false, | |
"profile_text_color": "575e61", | |
"lang": "en", | |
"geo_enabled": false, | |
"profile_background_color": "181c1f", | |
"notifications": false, | |
"time_zone": "Arizona", | |
"verified": false, | |
"description": "Woohoo. I'm getting married.", | |
"friends_count": 599, | |
"profile_background_image_url": "http:\/\/a3.twimg.com\/profile_background_images\/96118017\/tcchalk_578_9428.jpg", | |
"statuses_count": 3343, | |
"status": { | |
"coordinates": null, | |
"favorited": false, | |
"truncated": false, | |
"created_at": "Sun Oct 31 06:09:04 +0000 2010", | |
"id_str": "29252665233", | |
"in_reply_to_user_id_str": "637113", | |
"text": "@RobotDeathSquad HEISENTHOUGHT ANGRY AT CEREMONY WITH TESTING OAUTH", | |
"contributors": null, | |
"id": 29252665233, | |
"in_reply_to_status_id_str": "29251616538", | |
"retweet_count": null, | |
"geo": null, | |
"retweeted": false, | |
"in_reply_to_user_id": 637113, | |
"source": "web", | |
"in_reply_to_screen_name": "RobotDeathSquad", | |
"place": null, | |
"in_reply_to_status_id": 29251616538 | |
}, | |
"following": false, | |
"show_all_inline_media": false, | |
"screen_name": "heisenthought" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment