diff --git a/CHANGELOG.md b/CHANGELOG.md index dcb93142..d6642cd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog ## HEAD +* Remove the dependency on OpenStruct in the test code [#382](https://github.com/Sorcery/sorcery/pull/382) * Add Ruby 3.4 to CI matrix [#381](https://github.com/Sorcery/sorcery/pull/381) * Fix CI failures [#379](https://github.com/Sorcery/sorcery/pull/379) * Fixed minor issues with test to get all green so that we can continue development [#377](https://github.com/Sorcery/sorcery/pull/377) diff --git a/spec/controllers/controller_oauth_spec.rb b/spec/controllers/controller_oauth_spec.rb index 5c2a62b6..925bc515 100644 --- a/spec/controllers/controller_oauth_spec.rb +++ b/spec/controllers/controller_oauth_spec.rb @@ -1,39 +1,40 @@ require 'spec_helper' # require 'shared_examples/controller_oauth_shared_examples' -require 'ostruct' def stub_all_oauth_requests! consumer = OAuth::Consumer.new('key', 'secret', site: 'http://myapi.com') req_token = OAuth::RequestToken.new(consumer) acc_token = OAuth::AccessToken.new(consumer) - response = OpenStruct.new - response.body = { - 'following' => false, 'listed_count' => 0, 'profile_link_color' => '0084B4', - 'profile_image_url' => 'http://a1.twimg.com/profile_images/536178575/noamb_normal.jpg', - 'description' => 'Programmer/Heavy Metal Fan/New Father', - 'status' => { - 'text' => 'coming soon to sorcery gem: twitter and facebook authentication support.', - 'truncated' => false, 'favorited' => false, 'source' => 'web', 'geo' => nil, - 'in_reply_to_screen_name' => nil, 'in_reply_to_user_id' => nil, - 'in_reply_to_status_id_str' => nil, 'created_at' => 'Sun Mar 06 23:01:12 +0000 2011', - 'contributors' => nil, 'place' => nil, 'retweeted' => false, 'in_reply_to_status_id' => nil, - 'in_reply_to_user_id_str' => nil, 'coordinates' => nil, 'retweet_count' => 0, - 'id' => 44_533_012_284_706_816, 'id_str' => '44533012284706816' - }, - 'show_all_inline_media' => false, 'geo_enabled' => true, - 'profile_sidebar_border_color' => 'a8c7f7', 'url' => nil, 'followers_count' => 10, - 'screen_name' => 'nbenari', 'profile_use_background_image' => true, 'location' => 'Israel', - 'statuses_count' => 25, 'profile_background_color' => '022330', 'lang' => 'en', - 'verified' => false, 'notifications' => false, - 'profile_background_image_url' => 'http://a3.twimg.com/profile_background_images/104087198/04042010339.jpg', - 'favourites_count' => 5, 'created_at' => 'Fri Nov 20 21:58:19 +0000 2009', - 'is_translator' => false, 'contributors_enabled' => false, 'protected' => false, - 'follow_request_sent' => false, 'time_zone' => 'Greenland', 'profile_text_color' => '333333', - 'name' => 'Noam Ben Ari', 'friends_count' => 10, 'profile_sidebar_fill_color' => 'C0DFEC', - 'id' => 123, 'id_str' => '91434812', 'profile_background_tile' => false, 'utc_offset' => -10_800 - }.to_json + response = Object.new + def response.body + { + 'following' => false, 'listed_count' => 0, 'profile_link_color' => '0084B4', + 'profile_image_url' => 'http://a1.twimg.com/profile_images/536178575/noamb_normal.jpg', + 'description' => 'Programmer/Heavy Metal Fan/New Father', + 'status' => { + 'text' => 'coming soon to sorcery gem: twitter and facebook authentication support.', + 'truncated' => false, 'favorited' => false, 'source' => 'web', 'geo' => nil, + 'in_reply_to_screen_name' => nil, 'in_reply_to_user_id' => nil, + 'in_reply_to_status_id_str' => nil, 'created_at' => 'Sun Mar 06 23:01:12 +0000 2011', + 'contributors' => nil, 'place' => nil, 'retweeted' => false, 'in_reply_to_status_id' => nil, + 'in_reply_to_user_id_str' => nil, 'coordinates' => nil, 'retweet_count' => 0, + 'id' => 44_533_012_284_706_816, 'id_str' => '44533012284706816' + }, + 'show_all_inline_media' => false, 'geo_enabled' => true, + 'profile_sidebar_border_color' => 'a8c7f7', 'url' => nil, 'followers_count' => 10, + 'screen_name' => 'nbenari', 'profile_use_background_image' => true, 'location' => 'Israel', + 'statuses_count' => 25, 'profile_background_color' => '022330', 'lang' => 'en', + 'verified' => false, 'notifications' => false, + 'profile_background_image_url' => 'http://a3.twimg.com/profile_background_images/104087198/04042010339.jpg', + 'favourites_count' => 5, 'created_at' => 'Fri Nov 20 21:58:19 +0000 2009', + 'is_translator' => false, 'contributors_enabled' => false, 'protected' => false, + 'follow_request_sent' => false, 'time_zone' => 'Greenland', 'profile_text_color' => '333333', + 'name' => 'Noam Ben Ari', 'friends_count' => 10, 'profile_sidebar_fill_color' => 'C0DFEC', + 'id' => 123, 'id_str' => '91434812', 'profile_background_tile' => false, 'utc_offset' => -10_800 + }.to_json + end session[:request_token] = req_token.token session[:request_token_secret] = req_token.secret