twitter 5.8.0 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +10 -36
- data/lib/twitter/base.rb +20 -3
- data/lib/twitter/basic_user.rb +6 -4
- data/lib/twitter/client.rb +2 -1
- data/lib/twitter/configuration.rb +1 -1
- data/lib/twitter/cursor.rb +1 -1
- data/lib/twitter/entities.rb +10 -6
- data/lib/twitter/enumerable.rb +2 -2
- data/lib/twitter/error.rb +7 -0
- data/lib/twitter/geo_results.rb +1 -1
- data/lib/twitter/list.rb +3 -2
- data/lib/twitter/media/photo.rb +1 -1
- data/lib/twitter/place.rb +13 -15
- data/lib/twitter/profile.rb +1 -1
- data/lib/twitter/profile_banner.rb +1 -1
- data/lib/twitter/rest/client.rb +17 -2
- data/lib/twitter/rest/friends_and_followers.rb +1 -1
- data/lib/twitter/rest/lists.rb +4 -2
- data/lib/twitter/rest/spam_reporting.rb +1 -1
- data/lib/twitter/rest/tweets.rb +17 -17
- data/lib/twitter/rest/users.rb +77 -13
- data/lib/twitter/rest/utils.rb +10 -6
- data/lib/twitter/search_results.rb +1 -1
- data/lib/twitter/settings.rb +4 -3
- data/lib/twitter/source_user.rb +3 -2
- data/lib/twitter/streaming/client.rb +7 -2
- data/lib/twitter/streaming/connection.rb +9 -2
- data/lib/twitter/streaming/response.rb +3 -3
- data/lib/twitter/suggestion.rb +1 -1
- data/lib/twitter/target_user.rb +1 -1
- data/lib/twitter/trend.rb +2 -1
- data/lib/twitter/trend_results.rb +1 -1
- data/lib/twitter/tweet.rb +4 -4
- data/lib/twitter/user.rb +60 -19
- data/lib/twitter/utils.rb +12 -5
- data/lib/twitter/version.rb +1 -1
- data/spec/fixtures/following.json +1 -1
- data/spec/fixtures/sferik.json +1 -1
- data/spec/helper.rb +14 -5
- data/spec/twitter/base_spec.rb +16 -4
- data/spec/twitter/direct_message_spec.rb +12 -13
- data/spec/twitter/entity/uri_spec.rb +2 -2
- data/spec/twitter/error_spec.rb +2 -2
- data/spec/twitter/media/photo_spec.rb +4 -4
- data/spec/twitter/oembed_spec.rb +3 -3
- data/spec/twitter/place_spec.rb +1 -1
- data/spec/twitter/rest/client_spec.rb +54 -14
- data/spec/twitter/rest/friends_and_followers_spec.rb +76 -76
- data/spec/twitter/rest/lists_spec.rb +85 -64
- data/spec/twitter/rest/timelines_spec.rb +2 -2
- data/spec/twitter/rest/tweets_spec.rb +20 -16
- data/spec/twitter/rest/undocumented_spec.rb +17 -17
- data/spec/twitter/rest/users_spec.rb +101 -17
- data/spec/twitter/streaming/client_spec.rb +1 -1
- data/spec/twitter/streaming/connection_spec.rb +32 -0
- data/spec/twitter/streaming/response_spec.rb +21 -0
- data/spec/twitter/trend_spec.rb +1 -1
- data/spec/twitter/tweet_spec.rb +14 -23
- data/spec/twitter/user_spec.rb +120 -13
- data/twitter.gemspec +3 -3
- metadata +8 -4
@@ -9,11 +9,11 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
9
9
|
describe '#friend_ids' do
|
10
10
|
context 'with a screen name passed' do
|
11
11
|
before do
|
12
|
-
stub_get('/1.1/friends/ids.json').with(:query => {:
|
12
|
+
stub_get('/1.1/friends/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
13
13
|
end
|
14
14
|
it 'requests the correct resource' do
|
15
15
|
@client.friend_ids('sferik')
|
16
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
16
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
17
17
|
end
|
18
18
|
it 'returns an array of numeric IDs for every user the specified user is following' do
|
19
19
|
friend_ids = @client.friend_ids('sferik')
|
@@ -22,43 +22,43 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
22
22
|
end
|
23
23
|
context 'with each' do
|
24
24
|
before do
|
25
|
-
stub_get('/1.1/friends/ids.json').with(:query => {:
|
25
|
+
stub_get('/1.1/friends/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
26
26
|
end
|
27
27
|
it 'requests the correct resource' do
|
28
28
|
@client.friend_ids('sferik').each {}
|
29
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
30
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
29
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
30
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '1305102810874389703'})).to have_been_made
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
34
|
context 'with a user ID passed' do
|
35
35
|
before do
|
36
|
-
stub_get('/1.1/friends/ids.json').with(:query => {:
|
36
|
+
stub_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
37
37
|
end
|
38
38
|
it 'requests the correct resource' do
|
39
39
|
@client.friend_ids(7_505_382)
|
40
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
40
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
41
41
|
end
|
42
42
|
context 'with each' do
|
43
43
|
before do
|
44
|
-
stub_get('/1.1/friends/ids.json').with(:query => {:
|
44
|
+
stub_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
45
45
|
end
|
46
46
|
it 'requests the correct resource' do
|
47
47
|
@client.friend_ids(7_505_382).each {}
|
48
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
49
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
48
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
49
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'})).to have_been_made
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
53
|
context 'without arguments passed' do
|
54
54
|
before do
|
55
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
56
|
-
stub_get('/1.1/friends/ids.json').with(:query => {:
|
55
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
56
|
+
stub_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
57
57
|
end
|
58
58
|
it 'requests the correct resource' do
|
59
59
|
@client.friend_ids
|
60
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
61
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
60
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
61
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
62
62
|
end
|
63
63
|
it 'returns an array of numeric IDs for every user the specified user is following' do
|
64
64
|
friend_ids = @client.friend_ids
|
@@ -67,13 +67,13 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
67
67
|
end
|
68
68
|
context 'with each' do
|
69
69
|
before do
|
70
|
-
stub_get('/1.1/friends/ids.json').with(:query => {:
|
70
|
+
stub_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
71
71
|
end
|
72
72
|
it 'requests the correct resource' do
|
73
73
|
@client.friend_ids.each {}
|
74
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
75
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
76
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
74
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
75
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
76
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'})).to have_been_made
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
@@ -82,11 +82,11 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
82
82
|
describe '#follower_ids' do
|
83
83
|
context 'with a screen name passed' do
|
84
84
|
before do
|
85
|
-
stub_get('/1.1/followers/ids.json').with(:query => {:
|
85
|
+
stub_get('/1.1/followers/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
86
86
|
end
|
87
87
|
it 'requests the correct resource' do
|
88
88
|
@client.follower_ids('sferik')
|
89
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
89
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
90
90
|
end
|
91
91
|
it 'returns an array of numeric IDs for every user following the specified user' do
|
92
92
|
follower_ids = @client.follower_ids('sferik')
|
@@ -95,43 +95,43 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
95
95
|
end
|
96
96
|
context 'with each' do
|
97
97
|
before do
|
98
|
-
stub_get('/1.1/followers/ids.json').with(:query => {:
|
98
|
+
stub_get('/1.1/followers/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
99
99
|
end
|
100
100
|
it 'requests the correct resource' do
|
101
101
|
@client.follower_ids('sferik').each {}
|
102
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
103
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
102
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
103
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:screen_name => 'sferik', :cursor => '1305102810874389703'})).to have_been_made
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
107
107
|
context 'with a user ID passed' do
|
108
108
|
before do
|
109
|
-
stub_get('/1.1/followers/ids.json').with(:query => {:
|
109
|
+
stub_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
110
110
|
end
|
111
111
|
it 'requests the correct resource' do
|
112
112
|
@client.follower_ids(7_505_382)
|
113
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
113
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
114
114
|
end
|
115
115
|
context 'with each' do
|
116
116
|
before do
|
117
|
-
stub_get('/1.1/followers/ids.json').with(:query => {:
|
117
|
+
stub_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
118
118
|
end
|
119
119
|
it 'requests the correct resource' do
|
120
120
|
@client.follower_ids(7_505_382).each {}
|
121
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
122
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
121
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
122
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'})).to have_been_made
|
123
123
|
end
|
124
124
|
end
|
125
125
|
end
|
126
126
|
context 'without arguments passed' do
|
127
127
|
before do
|
128
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
129
|
-
stub_get('/1.1/followers/ids.json').with(:query => {:
|
128
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
129
|
+
stub_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('ids_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
130
130
|
end
|
131
131
|
it 'requests the correct resource' do
|
132
132
|
@client.follower_ids
|
133
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
134
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
133
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
134
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
135
135
|
end
|
136
136
|
it 'returns an array of numeric IDs for every user following the specified user' do
|
137
137
|
follower_ids = @client.follower_ids
|
@@ -140,13 +140,13 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
140
140
|
end
|
141
141
|
context 'with each' do
|
142
142
|
before do
|
143
|
-
stub_get('/1.1/followers/ids.json').with(:query => {:
|
143
|
+
stub_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
144
144
|
end
|
145
145
|
it 'requests the correct resource' do
|
146
146
|
@client.follower_ids.each {}
|
147
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
148
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
149
|
-
expect(a_get('/1.1/followers/ids.json').with(:query => {:
|
147
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
148
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
149
|
+
expect(a_get('/1.1/followers/ids.json').with(:query => {:user_id => '7505382', :cursor => '1305102810874389703'})).to have_been_made
|
150
150
|
end
|
151
151
|
end
|
152
152
|
end
|
@@ -294,15 +294,15 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
294
294
|
|
295
295
|
describe '#follow' do
|
296
296
|
before do
|
297
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
298
|
-
stub_get('/1.1/friends/ids.json').with(:query => {:
|
297
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
298
|
+
stub_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('ids_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
299
299
|
stub_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'}).to_return(:body => fixture('friendships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
300
300
|
stub_post('/1.1/friendships/create.json').with(:body => {:user_id => '7505382'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
301
301
|
end
|
302
302
|
it 'requests the correct resource' do
|
303
303
|
@client.follow('sferik', 'pengwynn')
|
304
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
305
|
-
expect(a_get('/1.1/friends/ids.json').with(:query => {:
|
304
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
305
|
+
expect(a_get('/1.1/friends/ids.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
306
306
|
expect(a_post('/1.1/users/lookup.json').with(:body => {:screen_name => 'sferik,pengwynn'})).to have_been_made
|
307
307
|
expect(a_post('/1.1/friendships/create.json').with(:body => {:user_id => '7505382'})).to have_been_made
|
308
308
|
end
|
@@ -502,11 +502,11 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
502
502
|
describe '#followers' do
|
503
503
|
context 'with a screen_name passed' do
|
504
504
|
before do
|
505
|
-
stub_get('/1.1/followers/list.json').with(:query => {:
|
505
|
+
stub_get('/1.1/followers/list.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('followers_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
506
506
|
end
|
507
507
|
it 'requests the correct resource' do
|
508
508
|
@client.followers('sferik')
|
509
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
509
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
510
510
|
end
|
511
511
|
it 'returns a cursor of followers with details for every user the specified user is followed by' do
|
512
512
|
followers = @client.followers('sferik')
|
@@ -515,43 +515,43 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
515
515
|
end
|
516
516
|
context 'with each' do
|
517
517
|
before do
|
518
|
-
stub_get('/1.1/followers/list.json').with(:query => {:
|
518
|
+
stub_get('/1.1/followers/list.json').with(:query => {:screen_name => 'sferik', :cursor => '1419103567112105362'}).to_return(:body => fixture('followers_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
519
519
|
end
|
520
520
|
it 'requests the correct resource' do
|
521
521
|
@client.followers('sferik').each {}
|
522
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
523
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
522
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
523
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:screen_name => 'sferik', :cursor => '1419103567112105362'})).to have_been_made
|
524
524
|
end
|
525
525
|
end
|
526
526
|
end
|
527
527
|
context 'with a user ID passed' do
|
528
528
|
before do
|
529
|
-
stub_get('/1.1/followers/list.json').with(:query => {:
|
529
|
+
stub_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('followers_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
530
530
|
end
|
531
531
|
it 'requests the correct resource' do
|
532
532
|
@client.followers(7_505_382)
|
533
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
533
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
534
534
|
end
|
535
535
|
context 'with each' do
|
536
536
|
before do
|
537
|
-
stub_get('/1.1/followers/list.json').with(:query => {:
|
537
|
+
stub_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '1419103567112105362'}).to_return(:body => fixture('followers_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
538
538
|
end
|
539
539
|
it 'requests the correct resource' do
|
540
540
|
@client.followers(7_505_382).each {}
|
541
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
542
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
541
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
542
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '1419103567112105362'})).to have_been_made
|
543
543
|
end
|
544
544
|
end
|
545
545
|
end
|
546
546
|
context 'without arguments passed' do
|
547
547
|
before do
|
548
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
549
|
-
stub_get('/1.1/followers/list.json').with(:query => {:
|
548
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
549
|
+
stub_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('followers_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
550
550
|
end
|
551
551
|
it 'requests the correct resource' do
|
552
552
|
@client.followers
|
553
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
554
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
553
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
554
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
555
555
|
end
|
556
556
|
it 'returns a cursor of followers with details for every user the specified user is followed by' do
|
557
557
|
followers = @client.followers
|
@@ -560,13 +560,13 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
560
560
|
end
|
561
561
|
context 'with each' do
|
562
562
|
before do
|
563
|
-
stub_get('/1.1/followers/list.json').with(:query => {:
|
563
|
+
stub_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '1419103567112105362'}).to_return(:body => fixture('followers_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
564
564
|
end
|
565
565
|
it 'requests the correct resource' do
|
566
566
|
@client.followers.each {}
|
567
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
568
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
569
|
-
expect(a_get('/1.1/followers/list.json').with(:query => {:
|
567
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
568
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
569
|
+
expect(a_get('/1.1/followers/list.json').with(:query => {:user_id => '7505382', :cursor => '1419103567112105362'})).to have_been_made
|
570
570
|
end
|
571
571
|
end
|
572
572
|
end
|
@@ -575,11 +575,11 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
575
575
|
describe '#friends' do
|
576
576
|
context 'with a screen_name passed' do
|
577
577
|
before do
|
578
|
-
stub_get('/1.1/friends/list.json').with(:query => {:
|
578
|
+
stub_get('/1.1/friends/list.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'}).to_return(:body => fixture('friends_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
579
579
|
end
|
580
580
|
it 'requests the correct resource' do
|
581
581
|
@client.friends('sferik')
|
582
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
582
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
583
583
|
end
|
584
584
|
it 'returns a cursor of friends with details for every user the specified user is following' do
|
585
585
|
friends = @client.friends('sferik')
|
@@ -588,43 +588,43 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
588
588
|
end
|
589
589
|
context 'with each' do
|
590
590
|
before do
|
591
|
-
stub_get('/1.1/friends/list.json').with(:query => {:
|
591
|
+
stub_get('/1.1/friends/list.json').with(:query => {:screen_name => 'sferik', :cursor => '1418947360875712729'}).to_return(:body => fixture('friends_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
592
592
|
end
|
593
593
|
it 'requests the correct resource' do
|
594
594
|
@client.friends('sferik').each {}
|
595
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
596
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
595
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:screen_name => 'sferik', :cursor => '-1'})).to have_been_made
|
596
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:screen_name => 'sferik', :cursor => '1418947360875712729'})).to have_been_made
|
597
597
|
end
|
598
598
|
end
|
599
599
|
end
|
600
600
|
context 'with a user ID passed' do
|
601
601
|
before do
|
602
|
-
stub_get('/1.1/friends/list.json').with(:query => {:
|
602
|
+
stub_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('friends_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
603
603
|
end
|
604
604
|
it 'requests the correct resource' do
|
605
605
|
@client.friends(7_505_382)
|
606
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
606
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
607
607
|
end
|
608
608
|
context 'with each' do
|
609
609
|
before do
|
610
|
-
stub_get('/1.1/friends/list.json').with(:query => {:
|
610
|
+
stub_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '1418947360875712729'}).to_return(:body => fixture('friends_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
611
611
|
end
|
612
612
|
it 'requests the correct resource' do
|
613
613
|
@client.friends(7_505_382).each {}
|
614
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
615
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
614
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
615
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '1418947360875712729'})).to have_been_made
|
616
616
|
end
|
617
617
|
end
|
618
618
|
end
|
619
619
|
context 'without arguments passed' do
|
620
620
|
before do
|
621
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
622
|
-
stub_get('/1.1/friends/list.json').with(:query => {:
|
621
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
622
|
+
stub_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('friends_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
623
623
|
end
|
624
624
|
it 'requests the correct resource' do
|
625
625
|
@client.friends
|
626
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
627
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
626
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
627
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
628
628
|
end
|
629
629
|
it 'returns a cursor of friends with details for every user the specified user is following' do
|
630
630
|
friends = @client.friends
|
@@ -633,13 +633,13 @@ describe Twitter::REST::FriendsAndFollowers do
|
|
633
633
|
end
|
634
634
|
context 'with each' do
|
635
635
|
before do
|
636
|
-
stub_get('/1.1/friends/list.json').with(:query => {:
|
636
|
+
stub_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '1418947360875712729'}).to_return(:body => fixture('friends_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
637
637
|
end
|
638
638
|
it 'requests the correct resource' do
|
639
639
|
@client.friends.each {}
|
640
|
-
expect(a_get('/1.1/account/verify_credentials.json')).to have_been_made
|
641
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
642
|
-
expect(a_get('/1.1/friends/list.json').with(:query => {:
|
640
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
641
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
642
|
+
expect(a_get('/1.1/friends/list.json').with(:query => {:user_id => '7505382', :cursor => '1418947360875712729'})).to have_been_made
|
643
643
|
end
|
644
644
|
end
|
645
645
|
end
|
@@ -67,12 +67,13 @@ describe Twitter::REST::Lists do
|
|
67
67
|
end
|
68
68
|
context 'without a screen name passed' do
|
69
69
|
before do
|
70
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
71
|
-
stub_get('/1.1/lists/statuses.json').with(:query => {:
|
70
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
71
|
+
stub_get('/1.1/lists/statuses.json').with(:query => {:owner_id => '7505382', :slug => 'presidents'}).to_return(:body => fixture('statuses.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
72
72
|
end
|
73
73
|
it 'requests the correct resource' do
|
74
74
|
@client.list_timeline('presidents')
|
75
|
-
expect(a_get('/1.1/
|
75
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
76
|
+
expect(a_get('/1.1/lists/statuses.json').with(:query => {:owner_id => '7505382', :slug => 'presidents'})).to have_been_made
|
76
77
|
end
|
77
78
|
end
|
78
79
|
end
|
@@ -94,12 +95,13 @@ describe Twitter::REST::Lists do
|
|
94
95
|
end
|
95
96
|
context 'without a screen name passed' do
|
96
97
|
before do
|
97
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
98
|
-
stub_post('/1.1/lists/members/destroy.json').with(:body => {:
|
98
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
99
|
+
stub_post('/1.1/lists/members/destroy.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
99
100
|
end
|
100
101
|
it 'requests the correct resource' do
|
101
102
|
@client.remove_list_member('presidents', 813_286)
|
102
|
-
expect(
|
103
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
104
|
+
expect(a_post('/1.1/lists/members/destroy.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'})).to have_been_made
|
103
105
|
end
|
104
106
|
end
|
105
107
|
end
|
@@ -151,21 +153,23 @@ describe Twitter::REST::Lists do
|
|
151
153
|
end
|
152
154
|
context 'without a screen name passed' do
|
153
155
|
before do
|
154
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
155
|
-
stub_get('/1.1/lists/memberships.json').with(:query => {:
|
156
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
157
|
+
stub_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('memberships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
156
158
|
end
|
157
159
|
it 'requests the correct resource' do
|
158
160
|
@client.memberships
|
159
|
-
expect(a_get('/1.1/
|
161
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
162
|
+
expect(a_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
160
163
|
end
|
161
164
|
context 'with each' do
|
162
165
|
before do
|
163
|
-
stub_get('/1.1/lists/memberships.json').with(:query => {:
|
166
|
+
stub_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'}).to_return(:body => fixture('memberships2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
164
167
|
end
|
165
168
|
it 'requests the correct resource' do
|
166
169
|
@client.memberships.each {}
|
167
|
-
expect(a_get('/1.1/
|
168
|
-
expect(a_get('/1.1/lists/memberships.json').with(:query => {:
|
170
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
171
|
+
expect(a_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
172
|
+
expect(a_get('/1.1/lists/memberships.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'})).to have_been_made
|
169
173
|
end
|
170
174
|
end
|
171
175
|
end
|
@@ -218,21 +222,23 @@ describe Twitter::REST::Lists do
|
|
218
222
|
end
|
219
223
|
context 'without a screen name passed' do
|
220
224
|
before do
|
221
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
222
|
-
stub_get('/1.1/lists/subscribers.json').with(:query => {:
|
225
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
226
|
+
stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
223
227
|
end
|
224
228
|
it 'requests the correct resource' do
|
225
229
|
@client.list_subscribers('presidents')
|
226
|
-
expect(a_get('/1.1/
|
230
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
231
|
+
expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
|
227
232
|
end
|
228
233
|
context 'with each' do
|
229
234
|
before do
|
230
|
-
stub_get('/1.1/lists/subscribers.json').with(:query => {:
|
235
|
+
stub_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
231
236
|
end
|
232
237
|
it 'requests the correct resource' do
|
233
238
|
@client.list_subscribers('presidents').each {}
|
234
|
-
expect(a_get('/1.1/
|
235
|
-
expect(a_get('/1.1/lists/subscribers.json').with(:query => {:
|
239
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
240
|
+
expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
|
241
|
+
expect(a_get('/1.1/lists/subscribers.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
|
236
242
|
end
|
237
243
|
end
|
238
244
|
end
|
@@ -255,12 +261,13 @@ describe Twitter::REST::Lists do
|
|
255
261
|
end
|
256
262
|
context 'without a screen name passed' do
|
257
263
|
before do
|
258
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
259
|
-
stub_post('/1.1/lists/subscribers/create.json').with(:body => {:
|
264
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
265
|
+
stub_post('/1.1/lists/subscribers/create.json').with(:body => {:owner_id => '7505382', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
260
266
|
end
|
261
267
|
it 'requests the correct resource' do
|
262
268
|
@client.list_subscribe('presidents')
|
263
|
-
expect(
|
269
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
270
|
+
expect(a_post('/1.1/lists/subscribers/create.json').with(:body => {:owner_id => '7505382', :slug => 'presidents'})).to have_been_made
|
264
271
|
end
|
265
272
|
end
|
266
273
|
end
|
@@ -328,12 +335,13 @@ describe Twitter::REST::Lists do
|
|
328
335
|
end
|
329
336
|
context 'without a screen name passed' do
|
330
337
|
before do
|
331
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
332
|
-
stub_get('/1.1/lists/subscribers/show.json').with(:query => {:
|
338
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
339
|
+
stub_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
333
340
|
end
|
334
341
|
it 'requests the correct resource' do
|
335
342
|
@client.list_subscriber?('presidents', 813_286)
|
336
|
-
expect(a_get('/1.1/
|
343
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
344
|
+
expect(a_get('/1.1/lists/subscribers/show.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'})).to have_been_made
|
337
345
|
end
|
338
346
|
end
|
339
347
|
end
|
@@ -355,12 +363,13 @@ describe Twitter::REST::Lists do
|
|
355
363
|
end
|
356
364
|
context 'without a screen name passed' do
|
357
365
|
before do
|
358
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
359
|
-
stub_post('/1.1/lists/subscribers/destroy.json').with(:body => {:
|
366
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
367
|
+
stub_post('/1.1/lists/subscribers/destroy.json').with(:body => {:owner_id => '7505382', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
360
368
|
end
|
361
369
|
it 'requests the correct resource' do
|
362
370
|
@client.list_unsubscribe('presidents')
|
363
|
-
expect(
|
371
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
372
|
+
expect(a_post('/1.1/lists/subscribers/destroy.json').with(:body => {:owner_id => '7505382', :slug => 'presidents'})).to have_been_made
|
364
373
|
end
|
365
374
|
end
|
366
375
|
end
|
@@ -391,12 +400,13 @@ describe Twitter::REST::Lists do
|
|
391
400
|
end
|
392
401
|
context 'without a screen name passed' do
|
393
402
|
before do
|
394
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
395
|
-
stub_post('/1.1/lists/members/create_all.json').with(:body => {:
|
403
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
404
|
+
stub_post('/1.1/lists/members/create_all.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286,18755393'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
396
405
|
end
|
397
406
|
it 'requests the correct resource' do
|
398
407
|
@client.add_list_members('presidents', [813_286, 18_755_393])
|
399
|
-
expect(
|
408
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
409
|
+
expect(a_post('/1.1/lists/members/create_all.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286,18755393'})).to have_been_made
|
400
410
|
end
|
401
411
|
end
|
402
412
|
end
|
@@ -455,7 +465,7 @@ describe Twitter::REST::Lists do
|
|
455
465
|
end
|
456
466
|
context 'with a screen name passed for user_to_check' do
|
457
467
|
before do
|
458
|
-
stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application
|
468
|
+
stub_get('/1.1/lists/members/show.json').with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents', :screen_name => 'erebor'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
459
469
|
end
|
460
470
|
it 'requests the correct resource' do
|
461
471
|
@client.list_member?('sferik', 'presidents', 'erebor')
|
@@ -464,12 +474,13 @@ describe Twitter::REST::Lists do
|
|
464
474
|
end
|
465
475
|
context 'without a screen name passed' do
|
466
476
|
before do
|
467
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
468
|
-
stub_get('/1.1/lists/members/show.json').with(:query => {:
|
477
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
478
|
+
stub_get('/1.1/lists/members/show.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
469
479
|
end
|
470
480
|
it 'requests the correct resource' do
|
471
481
|
@client.list_member?('presidents', 813_286)
|
472
|
-
expect(a_get('/1.1/
|
482
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
483
|
+
expect(a_get('/1.1/lists/members/show.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'})).to have_been_made
|
473
484
|
end
|
474
485
|
end
|
475
486
|
end
|
@@ -521,21 +532,23 @@ describe Twitter::REST::Lists do
|
|
521
532
|
end
|
522
533
|
context 'without a screen name passed' do
|
523
534
|
before do
|
524
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
525
|
-
stub_get('/1.1/lists/members.json').with(:query => {:
|
535
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
536
|
+
stub_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'}).to_return(:body => fixture('users_list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
526
537
|
end
|
527
538
|
it 'requests the correct resource' do
|
528
539
|
@client.list_members('presidents')
|
529
|
-
expect(a_get('/1.1/
|
540
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
541
|
+
expect(a_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
|
530
542
|
end
|
531
543
|
context 'with each' do
|
532
544
|
before do
|
533
|
-
stub_get('/1.1/lists/members.json').with(:query => {:
|
545
|
+
stub_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'}).to_return(:body => fixture('users_list2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
534
546
|
end
|
535
547
|
it 'requests the correct resource' do
|
536
548
|
@client.list_members('presidents').each {}
|
537
|
-
expect(a_get('/1.1/
|
538
|
-
expect(a_get('/1.1/lists/members.json').with(:query => {:
|
549
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
550
|
+
expect(a_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '-1'})).to have_been_made
|
551
|
+
expect(a_get('/1.1/lists/members.json').with(:query => {:owner_id => '7505382', :slug => 'presidents', :cursor => '1322801608223717003'})).to have_been_made
|
539
552
|
end
|
540
553
|
end
|
541
554
|
end
|
@@ -558,12 +571,13 @@ describe Twitter::REST::Lists do
|
|
558
571
|
end
|
559
572
|
context 'without a screen name passed' do
|
560
573
|
before do
|
561
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
562
|
-
stub_post('/1.1/lists/members/create.json').with(:body => {:
|
574
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
575
|
+
stub_post('/1.1/lists/members/create.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
563
576
|
end
|
564
577
|
it 'requests the correct resource' do
|
565
578
|
@client.add_list_member('presidents', 813_286)
|
566
|
-
expect(
|
579
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
580
|
+
expect(a_post('/1.1/lists/members/create.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286'})).to have_been_made
|
567
581
|
end
|
568
582
|
end
|
569
583
|
end
|
@@ -585,12 +599,13 @@ describe Twitter::REST::Lists do
|
|
585
599
|
end
|
586
600
|
context 'without a screen name passed' do
|
587
601
|
before do
|
588
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
589
|
-
stub_post('/1.1/lists/destroy.json').with(:body => {:
|
602
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
603
|
+
stub_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
590
604
|
end
|
591
605
|
it 'requests the correct resource' do
|
592
606
|
@client.destroy_list('presidents')
|
593
|
-
expect(
|
607
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
608
|
+
expect(a_post('/1.1/lists/destroy.json').with(:body => {:owner_id => '7505382', :slug => 'presidents'})).to have_been_made
|
594
609
|
end
|
595
610
|
end
|
596
611
|
context 'with a list ID passed' do
|
@@ -631,12 +646,13 @@ describe Twitter::REST::Lists do
|
|
631
646
|
end
|
632
647
|
context 'without a screen name passed' do
|
633
648
|
before do
|
634
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
635
|
-
stub_post('/1.1/lists/update.json').with(:body => {:
|
649
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
650
|
+
stub_post('/1.1/lists/update.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :description => 'Presidents of the United States of America'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
636
651
|
end
|
637
652
|
it 'requests the correct resource' do
|
638
653
|
@client.list_update('presidents', :description => 'Presidents of the United States of America')
|
639
|
-
expect(
|
654
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
655
|
+
expect(a_post('/1.1/lists/update.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :description => 'Presidents of the United States of America'})).to have_been_made
|
640
656
|
end
|
641
657
|
end
|
642
658
|
context 'with a list ID passed' do
|
@@ -711,12 +727,13 @@ describe Twitter::REST::Lists do
|
|
711
727
|
end
|
712
728
|
context 'without a screen name passed' do
|
713
729
|
before do
|
714
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
715
|
-
stub_get('/1.1/lists/show.json').with(:query => {:
|
730
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
731
|
+
stub_get('/1.1/lists/show.json').with(:query => {:owner_id => '7505382', :slug => 'presidents'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
716
732
|
end
|
717
733
|
it 'requests the correct resource' do
|
718
734
|
@client.list('presidents')
|
719
|
-
expect(a_get('/1.1/
|
735
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
736
|
+
expect(a_get('/1.1/lists/show.json').with(:query => {:owner_id => '7505382', :slug => 'presidents'})).to have_been_made
|
720
737
|
end
|
721
738
|
end
|
722
739
|
context 'with a list ID passed' do
|
@@ -787,21 +804,23 @@ describe Twitter::REST::Lists do
|
|
787
804
|
end
|
788
805
|
context 'without a screen name passed' do
|
789
806
|
before do
|
790
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
791
|
-
stub_get('/1.1/lists/subscriptions.json').with(:query => {:
|
807
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
808
|
+
stub_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('subscriptions.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
792
809
|
end
|
793
810
|
it 'requests the correct resource' do
|
794
811
|
@client.subscriptions
|
795
|
-
expect(a_get('/1.1/
|
812
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
813
|
+
expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
796
814
|
end
|
797
815
|
context 'with each' do
|
798
816
|
before do
|
799
|
-
stub_get('/1.1/lists/subscriptions.json').with(:query => {:
|
817
|
+
stub_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'}).to_return(:body => fixture('subscriptions2.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
800
818
|
end
|
801
819
|
it 'requests the correct resource' do
|
802
820
|
@client.subscriptions.each {}
|
803
|
-
expect(a_get('/1.1/
|
804
|
-
expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:
|
821
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
822
|
+
expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
823
|
+
expect(a_get('/1.1/lists/subscriptions.json').with(:query => {:user_id => '7505382', :cursor => '1401037770457540712'})).to have_been_made
|
805
824
|
end
|
806
825
|
end
|
807
826
|
end
|
@@ -842,12 +861,13 @@ describe Twitter::REST::Lists do
|
|
842
861
|
end
|
843
862
|
context 'without a screen name passed' do
|
844
863
|
before do
|
845
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
846
|
-
stub_post('/1.1/lists/members/destroy_all.json').with(:body => {:
|
864
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
865
|
+
stub_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286,18755393'}).to_return(:body => fixture('list.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
847
866
|
end
|
848
867
|
it 'requests the correct resource' do
|
849
868
|
@client.remove_list_members('presidents', [813_286, 18_755_393])
|
850
|
-
expect(
|
869
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
870
|
+
expect(a_post('/1.1/lists/members/destroy_all.json').with(:body => {:owner_id => '7505382', :slug => 'presidents', :user_id => '813286,18755393'})).to have_been_made
|
851
871
|
end
|
852
872
|
end
|
853
873
|
end
|
@@ -870,12 +890,13 @@ describe Twitter::REST::Lists do
|
|
870
890
|
end
|
871
891
|
context 'without a screen name passed' do
|
872
892
|
before do
|
873
|
-
stub_get('/1.1/account/verify_credentials.json').to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
874
|
-
stub_get('/1.1/lists/ownerships.json').with(:query => {:
|
893
|
+
stub_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'}).to_return(:body => fixture('sferik.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
894
|
+
stub_get('/1.1/lists/ownerships.json').with(:query => {:user_id => '7505382', :cursor => '-1'}).to_return(:body => fixture('ownerships.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
|
875
895
|
end
|
876
896
|
it 'requests the correct resource' do
|
877
897
|
@client.owned_lists
|
878
|
-
expect(a_get('/1.1/
|
898
|
+
expect(a_get('/1.1/account/verify_credentials.json').with(:query => {:include_entities => 'false', :skip_status => 'true'})).to have_been_made
|
899
|
+
expect(a_get('/1.1/lists/ownerships.json').with(:query => {:user_id => '7505382', :cursor => '-1'})).to have_been_made
|
879
900
|
end
|
880
901
|
it 'returns the requested list' do
|
881
902
|
lists = @client.owned_lists
|