Skip to content

Commit 7ddbfde

Browse files
authored
Merge pull request #382 from willnet/remove-ostruct-dependency
Remove the dependency on OpenStruct in the test code
2 parents b3e7793 + 81f8943 commit 7ddbfde

2 files changed

Lines changed: 29 additions & 27 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Changelog
22
## HEAD
3+
* Remove the dependency on OpenStruct in the test code [#382](https://github.com/Sorcery/sorcery/pull/382)
34
* Add Ruby 3.4 to CI matrix [#381](https://github.com/Sorcery/sorcery/pull/381)
45
* Fix CI failures [#379](https://github.com/Sorcery/sorcery/pull/379)
56
* Fixed minor issues with test to get all green so that we can continue development [#377](https://github.com/Sorcery/sorcery/pull/377)

spec/controllers/controller_oauth_spec.rb

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
11
require 'spec_helper'
22

33
# require 'shared_examples/controller_oauth_shared_examples'
4-
require 'ostruct'
54

65
def stub_all_oauth_requests!
76
consumer = OAuth::Consumer.new('key', 'secret', site: 'http://myapi.com')
87
req_token = OAuth::RequestToken.new(consumer)
98
acc_token = OAuth::AccessToken.new(consumer)
109

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
3738

3839
session[:request_token] = req_token.token
3940
session[:request_token_secret] = req_token.secret

0 commit comments

Comments
 (0)