|
1 | 1 | require 'spec_helper' |
2 | 2 |
|
3 | 3 | # require 'shared_examples/controller_oauth_shared_examples' |
4 | | -require 'ostruct' |
5 | 4 |
|
6 | 5 | def stub_all_oauth_requests! |
7 | 6 | consumer = OAuth::Consumer.new('key', 'secret', site: 'http://myapi.com') |
8 | 7 | req_token = OAuth::RequestToken.new(consumer) |
9 | 8 | acc_token = OAuth::AccessToken.new(consumer) |
10 | 9 |
|
11 | | - response = OpenStruct.new |
12 | | - response.body = { |
13 | | - 'following' => false, 'listed_count' => 0, 'profile_link_color' => '0084B4', |
14 | | - 'profile_image_url' => 'http://a1.twimg.com/profile_images/536178575/noamb_normal.jpg', |
15 | | - 'description' => 'Programmer/Heavy Metal Fan/New Father', |
16 | | - 'status' => { |
17 | | - 'text' => 'coming soon to sorcery gem: twitter and facebook authentication support.', |
18 | | - 'truncated' => false, 'favorited' => false, 'source' => 'web', 'geo' => nil, |
19 | | - 'in_reply_to_screen_name' => nil, 'in_reply_to_user_id' => nil, |
20 | | - 'in_reply_to_status_id_str' => nil, 'created_at' => 'Sun Mar 06 23:01:12 +0000 2011', |
21 | | - 'contributors' => nil, 'place' => nil, 'retweeted' => false, 'in_reply_to_status_id' => nil, |
22 | | - 'in_reply_to_user_id_str' => nil, 'coordinates' => nil, 'retweet_count' => 0, |
23 | | - 'id' => 44_533_012_284_706_816, 'id_str' => '44533012284706816' |
24 | | - }, |
25 | | - 'show_all_inline_media' => false, 'geo_enabled' => true, |
26 | | - 'profile_sidebar_border_color' => 'a8c7f7', 'url' => nil, 'followers_count' => 10, |
27 | | - 'screen_name' => 'nbenari', 'profile_use_background_image' => true, 'location' => 'Israel', |
28 | | - 'statuses_count' => 25, 'profile_background_color' => '022330', 'lang' => 'en', |
29 | | - 'verified' => false, 'notifications' => false, |
30 | | - 'profile_background_image_url' => 'http://a3.twimg.com/profile_background_images/104087198/04042010339.jpg', |
31 | | - 'favourites_count' => 5, 'created_at' => 'Fri Nov 20 21:58:19 +0000 2009', |
32 | | - 'is_translator' => false, 'contributors_enabled' => false, 'protected' => false, |
33 | | - 'follow_request_sent' => false, 'time_zone' => 'Greenland', 'profile_text_color' => '333333', |
34 | | - 'name' => 'Noam Ben Ari', 'friends_count' => 10, 'profile_sidebar_fill_color' => 'C0DFEC', |
35 | | - 'id' => 123, 'id_str' => '91434812', 'profile_background_tile' => false, 'utc_offset' => -10_800 |
36 | | - }.to_json |
| 10 | + response = Object.new |
| 11 | + def response.body |
| 12 | + { |
| 13 | + 'following' => false, 'listed_count' => 0, 'profile_link_color' => '0084B4', |
| 14 | + 'profile_image_url' => 'http://a1.twimg.com/profile_images/536178575/noamb_normal.jpg', |
| 15 | + 'description' => 'Programmer/Heavy Metal Fan/New Father', |
| 16 | + 'status' => { |
| 17 | + 'text' => 'coming soon to sorcery gem: twitter and facebook authentication support.', |
| 18 | + 'truncated' => false, 'favorited' => false, 'source' => 'web', 'geo' => nil, |
| 19 | + 'in_reply_to_screen_name' => nil, 'in_reply_to_user_id' => nil, |
| 20 | + 'in_reply_to_status_id_str' => nil, 'created_at' => 'Sun Mar 06 23:01:12 +0000 2011', |
| 21 | + 'contributors' => nil, 'place' => nil, 'retweeted' => false, 'in_reply_to_status_id' => nil, |
| 22 | + 'in_reply_to_user_id_str' => nil, 'coordinates' => nil, 'retweet_count' => 0, |
| 23 | + 'id' => 44_533_012_284_706_816, 'id_str' => '44533012284706816' |
| 24 | + }, |
| 25 | + 'show_all_inline_media' => false, 'geo_enabled' => true, |
| 26 | + 'profile_sidebar_border_color' => 'a8c7f7', 'url' => nil, 'followers_count' => 10, |
| 27 | + 'screen_name' => 'nbenari', 'profile_use_background_image' => true, 'location' => 'Israel', |
| 28 | + 'statuses_count' => 25, 'profile_background_color' => '022330', 'lang' => 'en', |
| 29 | + 'verified' => false, 'notifications' => false, |
| 30 | + 'profile_background_image_url' => 'http://a3.twimg.com/profile_background_images/104087198/04042010339.jpg', |
| 31 | + 'favourites_count' => 5, 'created_at' => 'Fri Nov 20 21:58:19 +0000 2009', |
| 32 | + 'is_translator' => false, 'contributors_enabled' => false, 'protected' => false, |
| 33 | + 'follow_request_sent' => false, 'time_zone' => 'Greenland', 'profile_text_color' => '333333', |
| 34 | + 'name' => 'Noam Ben Ari', 'friends_count' => 10, 'profile_sidebar_fill_color' => 'C0DFEC', |
| 35 | + 'id' => 123, 'id_str' => '91434812', 'profile_background_tile' => false, 'utc_offset' => -10_800 |
| 36 | + }.to_json |
| 37 | + end |
37 | 38 |
|
38 | 39 | session[:request_token] = req_token.token |
39 | 40 | session[:request_token_secret] = req_token.secret |
|
0 commit comments