twitter 4.8.1 → 5.0.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.
- data/CHANGELOG.md +36 -0
- data/CONTRIBUTING.md +13 -15
- data/LICENSE.md +1 -1
- data/README.md +401 -261
- data/Rakefile +6 -0
- data/lib/twitter/arguments.rb +14 -0
- data/lib/twitter/base.rb +109 -89
- data/lib/twitter/client.rb +38 -115
- data/lib/twitter/configuration.rb +5 -2
- data/lib/twitter/core_ext/kernel.rb +5 -1
- data/lib/twitter/creatable.rb +7 -4
- data/lib/twitter/cursor.rb +57 -45
- data/lib/twitter/direct_message.rb +2 -11
- data/lib/twitter/entity/uri.rb +14 -0
- data/lib/twitter/enumerable.rb +15 -0
- data/lib/twitter/error/already_favorited.rb +1 -1
- data/lib/twitter/error/already_posted.rb +10 -0
- data/lib/twitter/error/already_retweeted.rb +1 -1
- data/lib/twitter/error/bad_gateway.rb +2 -3
- data/lib/twitter/error/bad_request.rb +2 -2
- data/lib/twitter/error/forbidden.rb +2 -2
- data/lib/twitter/error/gateway_timeout.rb +2 -3
- data/lib/twitter/error/internal_server_error.rb +2 -3
- data/lib/twitter/error/not_acceptable.rb +2 -2
- data/lib/twitter/error/not_found.rb +2 -2
- data/lib/twitter/error/service_unavailable.rb +2 -3
- data/lib/twitter/error/too_many_requests.rb +2 -2
- data/lib/twitter/error/unauthorized.rb +2 -2
- data/lib/twitter/error/unprocessable_entity.rb +2 -2
- data/lib/twitter/error.rb +65 -14
- data/lib/twitter/factory.rb +13 -12
- data/lib/twitter/geo.rb +2 -7
- data/lib/twitter/geo_factory.rb +11 -7
- data/lib/twitter/geo_results.rb +40 -0
- data/lib/twitter/identity.rb +4 -34
- data/lib/twitter/list.rb +21 -4
- data/lib/twitter/media/photo.rb +6 -4
- data/lib/twitter/media_factory.rb +11 -7
- data/lib/twitter/null_object.rb +25 -0
- data/lib/twitter/oembed.rb +3 -2
- data/lib/twitter/place.rb +15 -15
- data/lib/twitter/profile_banner.rb +3 -2
- data/lib/twitter/rate_limit.rb +4 -17
- data/lib/twitter/relationship.rb +2 -19
- data/lib/twitter/rest/api/direct_messages.rb +138 -0
- data/lib/twitter/rest/api/favorites.rb +115 -0
- data/lib/twitter/rest/api/friends_and_followers.rb +287 -0
- data/lib/twitter/rest/api/help.rb +58 -0
- data/lib/twitter/rest/api/lists.rb +498 -0
- data/lib/twitter/rest/api/oauth.rb +62 -0
- data/lib/twitter/rest/api/places_and_geo.rb +86 -0
- data/lib/twitter/rest/api/saved_searches.rb +93 -0
- data/lib/twitter/rest/api/search.rb +37 -0
- data/lib/twitter/rest/api/spam_reporting.rb +29 -0
- data/lib/twitter/rest/api/suggested_users.rb +51 -0
- data/lib/twitter/rest/api/timelines.rb +202 -0
- data/lib/twitter/rest/api/trends.rb +58 -0
- data/lib/twitter/rest/api/tweets.rb +291 -0
- data/lib/twitter/rest/api/undocumented.rb +52 -0
- data/lib/twitter/rest/api/users.rb +383 -0
- data/lib/twitter/rest/api/utils.rb +246 -0
- data/lib/twitter/rest/client.rb +175 -0
- data/lib/twitter/rest/request/multipart_with_file.rb +36 -0
- data/lib/twitter/rest/response/parse_error_json.rb +15 -0
- data/lib/twitter/rest/response/parse_json.rb +31 -0
- data/lib/twitter/{response → rest/response}/raise_error.rb +8 -11
- data/lib/twitter/search_results.rb +37 -21
- data/lib/twitter/settings.rb +1 -6
- data/lib/twitter/size.rb +2 -15
- data/lib/twitter/streaming/client.rb +89 -0
- data/lib/twitter/streaming/connection.rb +22 -0
- data/lib/twitter/streaming/event.rb +35 -0
- data/lib/twitter/streaming/friend_list.rb +13 -0
- data/lib/twitter/streaming/message_parser.rb +18 -0
- data/lib/twitter/streaming/response.rb +34 -0
- data/lib/twitter/suggestion.rb +5 -8
- data/lib/twitter/token.rb +11 -1
- data/lib/twitter/trend.rb +4 -8
- data/lib/twitter/trend_results.rb +65 -0
- data/lib/twitter/tweet.rb +43 -92
- data/lib/twitter/user.rb +72 -47
- data/lib/twitter/version.rb +4 -4
- data/lib/twitter.rb +4 -39
- data/spec/fixtures/already_posted.json +1 -0
- data/spec/fixtures/ids_list.json +1 -1
- data/spec/fixtures/ids_list2.json +1 -1
- data/spec/fixtures/request_token.txt +6 -0
- data/spec/fixtures/search.json +1 -1
- data/spec/fixtures/search_malformed.json +1 -1
- data/spec/fixtures/track_streaming.json +3 -0
- data/spec/fixtures/track_streaming_user.json +5 -0
- data/spec/helper.rb +8 -13
- data/spec/twitter/base_spec.rb +13 -103
- data/spec/twitter/basic_user_spec.rb +3 -3
- data/spec/twitter/configuration_spec.rb +1 -1
- data/spec/twitter/cursor_spec.rb +17 -35
- data/spec/twitter/direct_message_spec.rb +44 -11
- data/spec/twitter/entity/uri_spec.rb +75 -0
- data/spec/twitter/error_spec.rb +59 -11
- data/spec/twitter/geo/point_spec.rb +6 -6
- data/spec/twitter/geo/polygon_spec.rb +5 -5
- data/spec/twitter/geo_factory_spec.rb +4 -4
- data/spec/twitter/geo_results_spec.rb +35 -0
- data/spec/twitter/geo_spec.rb +6 -6
- data/spec/twitter/identifiable_spec.rb +5 -26
- data/spec/twitter/list_spec.rb +54 -11
- data/spec/twitter/media/photo_spec.rb +122 -6
- data/spec/twitter/media_factory_spec.rb +3 -3
- data/spec/twitter/null_object_spec.rb +27 -0
- data/spec/twitter/oembed_spec.rb +69 -45
- data/spec/twitter/place_spec.rb +84 -28
- data/spec/twitter/profile_banner_spec.rb +1 -1
- data/spec/twitter/rate_limit_spec.rb +8 -25
- data/spec/twitter/relationship_spec.rb +26 -12
- data/spec/twitter/{api → rest/api}/direct_messages_spec.rb +28 -15
- data/spec/twitter/{api → rest/api}/favorites_spec.rb +80 -7
- data/spec/twitter/{api → rest/api}/friends_and_followers_spec.rb +121 -152
- data/spec/twitter/{api → rest/api}/geo_spec.rb +9 -23
- data/spec/twitter/{api → rest/api}/help_spec.rb +6 -6
- data/spec/twitter/{api → rest/api}/lists_spec.rb +116 -95
- data/spec/twitter/{api → rest/api}/oauth_spec.rb +21 -10
- data/spec/twitter/{api → rest/api}/saved_searches_spec.rb +13 -13
- data/spec/twitter/{api → rest/api}/search_spec.rb +8 -9
- data/spec/twitter/{api → rest/api}/spam_reporting_spec.rb +3 -3
- data/spec/twitter/{api → rest/api}/suggested_users_spec.rb +5 -5
- data/spec/twitter/{api → rest/api}/timelines_spec.rb +9 -9
- data/spec/twitter/{api → rest/api}/trends_spec.rb +6 -6
- data/spec/twitter/rest/api/tweets_spec.rb +503 -0
- data/spec/twitter/{api → rest/api}/undocumented_spec.rb +19 -45
- data/spec/twitter/{api → rest/api}/users_spec.rb +64 -39
- data/spec/twitter/rest/client_spec.rb +193 -0
- data/spec/twitter/saved_search_spec.rb +14 -3
- data/spec/twitter/search_results_spec.rb +32 -45
- data/spec/twitter/settings_spec.rb +17 -6
- data/spec/twitter/size_spec.rb +5 -15
- data/spec/twitter/source_user_spec.rb +3 -3
- data/spec/twitter/streaming/client_spec.rb +92 -0
- data/spec/twitter/streaming/event_spec.rb +45 -0
- data/spec/twitter/suggestion_spec.rb +5 -15
- data/spec/twitter/target_user_spec.rb +3 -3
- data/spec/twitter/token_spec.rb +16 -0
- data/spec/twitter/trend_results_spec.rb +89 -0
- data/spec/twitter/trend_spec.rb +26 -13
- data/spec/twitter/tweet_spec.rb +137 -124
- data/spec/twitter/user_spec.rb +139 -80
- data/spec/twitter_spec.rb +0 -119
- data/twitter.gemspec +12 -6
- data.tar.gz.sig +0 -0
- metadata +197 -138
- metadata.gz.sig +0 -0
- data/lib/twitter/action/favorite.rb +0 -19
- data/lib/twitter/action/follow.rb +0 -30
- data/lib/twitter/action/list_member_added.rb +0 -39
- data/lib/twitter/action/mention.rb +0 -46
- data/lib/twitter/action/reply.rb +0 -27
- data/lib/twitter/action/retweet.rb +0 -27
- data/lib/twitter/action/tweet.rb +0 -20
- data/lib/twitter/action_factory.rb +0 -22
- data/lib/twitter/api/arguments.rb +0 -13
- data/lib/twitter/api/direct_messages.rb +0 -148
- data/lib/twitter/api/favorites.rb +0 -126
- data/lib/twitter/api/friends_and_followers.rb +0 -334
- data/lib/twitter/api/help.rb +0 -64
- data/lib/twitter/api/lists.rb +0 -618
- data/lib/twitter/api/oauth.rb +0 -44
- data/lib/twitter/api/places_and_geo.rb +0 -121
- data/lib/twitter/api/saved_searches.rb +0 -99
- data/lib/twitter/api/search.rb +0 -37
- data/lib/twitter/api/spam_reporting.rb +0 -30
- data/lib/twitter/api/suggested_users.rb +0 -55
- data/lib/twitter/api/timelines.rb +0 -214
- data/lib/twitter/api/trends.rb +0 -63
- data/lib/twitter/api/tweets.rb +0 -304
- data/lib/twitter/api/undocumented.rb +0 -97
- data/lib/twitter/api/users.rb +0 -439
- data/lib/twitter/api/utils.rb +0 -187
- data/lib/twitter/configurable.rb +0 -96
- data/lib/twitter/default.rb +0 -102
- data/lib/twitter/entity/url.rb +0 -9
- data/lib/twitter/error/client_error.rb +0 -35
- data/lib/twitter/error/decode_error.rb +0 -9
- data/lib/twitter/error/identity_map_key_error.rb +0 -9
- data/lib/twitter/error/server_error.rb +0 -28
- data/lib/twitter/exceptable.rb +0 -36
- data/lib/twitter/identity_map.rb +0 -22
- data/lib/twitter/request/multipart_with_file.rb +0 -34
- data/lib/twitter/response/parse_json.rb +0 -25
- data/spec/fixtures/about_me.json +0 -1
- data/spec/fixtures/activity_summary.json +0 -1
- data/spec/fixtures/bad_gateway.json +0 -1
- data/spec/fixtures/bad_request.json +0 -1
- data/spec/fixtures/by_friends.json +0 -1
- data/spec/fixtures/end_session.json +0 -1
- data/spec/fixtures/forbidden.json +0 -1
- data/spec/fixtures/internal_server_error.json +0 -1
- data/spec/fixtures/not_acceptable.json +0 -1
- data/spec/fixtures/phoenix_search.phoenix +0 -1
- data/spec/fixtures/resolve.json +0 -1
- data/spec/fixtures/service_unavailable.json +0 -1
- data/spec/fixtures/totals.json +0 -1
- data/spec/fixtures/trends.json +0 -1
- data/spec/fixtures/unauthorized.json +0 -1
- data/spec/fixtures/video_facets.json +0 -1
- data/spec/twitter/action/favorite_spec.rb +0 -29
- data/spec/twitter/action/follow_spec.rb +0 -29
- data/spec/twitter/action/list_member_added_spec.rb +0 -41
- data/spec/twitter/action/mention_spec.rb +0 -52
- data/spec/twitter/action/reply_spec.rb +0 -41
- data/spec/twitter/action/retweet_spec.rb +0 -41
- data/spec/twitter/action_factory_spec.rb +0 -35
- data/spec/twitter/action_spec.rb +0 -16
- data/spec/twitter/api/tweets_spec.rb +0 -285
- data/spec/twitter/client_spec.rb +0 -223
- data/spec/twitter/error/client_error_spec.rb +0 -23
- data/spec/twitter/error/server_error_spec.rb +0 -20
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"error":"Unauthorized","request":"/1/statuses/user_timeline.json?screen_name=protected"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"id_str":"107989062362734594","in_reply_to_status_id":null,"truncated":false,"user":{"default_profile":false,"profile_sidebar_fill_color":"ffffff","protected":false,"id_str":"28201743","notifications":null,"profile_background_tile":false,"screen_name":"VEVO","name":"VEVO","listed_count":2587,"location":"US, Canada, UK, Ireland","show_all_inline_media":false,"contributors_enabled":false,"following":null,"geo_enabled":false,"utc_offset":-18000,"profile_link_color":"df2100","description":"VEVO: Music Evolution Revolution! Music videos and more...","profile_sidebar_border_color":"6f7172","url":"http:\/\/www.vevo.com\/","time_zone":"Eastern Time (US & Canada)","default_profile_image":false,"statuses_count":3510,"profile_use_background_image":true,"verified":false,"favourites_count":667,"friends_count":1095,"profile_background_color":"df2100","is_translator":false,"profile_background_image_url":"http:\/\/a3.twimg.com\/profile_background_images\/94390739\/vevo_logo.jpg","created_at":"Wed Apr 01 21:32:48 +0000 2009","followers_count":130612,"follow_request_sent":null,"lang":"en","profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/94390739\/vevo_logo.jpg","id":28201743,"profile_text_color":"6f7172","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1465999828\/v_logo_youtube_normal.jpg","profile_image_url":"http:\/\/a1.twimg.com\/profile_images\/1465999828\/v_logo_youtube_normal.jpg"},"favorited":false,"possibly_sensitive":false,"in_reply_to_status_id_str":null,"geo":null,"in_reply_to_screen_name":"foofighters","in_reply_to_user_id_str":"19081001","coordinates":null,"in_reply_to_user_id":19081001,"source":"web","created_at":"Mon Aug 29 01:32:53 +0000 2011","contributors":null,"retweeted":false,"retweet_count":8,"id":107989062362734594,"place":null,"text":"@Foofighters LEGENDS with a Legendary set of Music Videos http:\/\/t.co\/IcVGIQO #VMA #VEVO","url":"http:\/\/vevo.com\/artist\/foo-fighters"}]
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::Action::Favorite do
|
|
4
|
-
|
|
5
|
-
describe "#sources" do
|
|
6
|
-
it "returns a collection of users who favorited a Tweet" do
|
|
7
|
-
sources = Twitter::Action::Favorite.new(:sources => [{:id => 7505382}]).sources
|
|
8
|
-
expect(sources).to be_an Array
|
|
9
|
-
expect(sources.first).to be_a Twitter::User
|
|
10
|
-
end
|
|
11
|
-
it "is empty when not set" do
|
|
12
|
-
sources = Twitter::Action::Favorite.new.sources
|
|
13
|
-
expect(sources).to be_empty
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe "#targets" do
|
|
18
|
-
it "returns a collection containing the favorited Tweet" do
|
|
19
|
-
targets = Twitter::Action::Favorite.new(:targets => [{:id => 25938088801}]).targets
|
|
20
|
-
expect(targets).to be_an Array
|
|
21
|
-
expect(targets.first).to be_a Twitter::Tweet
|
|
22
|
-
end
|
|
23
|
-
it "is empty when not set" do
|
|
24
|
-
targets = Twitter::Action::Favorite.new.targets
|
|
25
|
-
expect(targets).to be_empty
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::Action::Follow do
|
|
4
|
-
|
|
5
|
-
describe "#sources" do
|
|
6
|
-
it "returns a collection of users who followed a user" do
|
|
7
|
-
sources = Twitter::Action::Follow.new(:sources => [{:id => 7505382}]).sources
|
|
8
|
-
expect(sources).to be_an Array
|
|
9
|
-
expect(sources.first).to be_a Twitter::User
|
|
10
|
-
end
|
|
11
|
-
it "is empty when not set" do
|
|
12
|
-
sources = Twitter::Action::Follow.new.sources
|
|
13
|
-
expect(sources).to be_empty
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe "#targets" do
|
|
18
|
-
it "returns a collection containing the followed user" do
|
|
19
|
-
targets = Twitter::Action::Follow.new(:targets => [{:id => 7505382}]).targets
|
|
20
|
-
expect(targets).to be_an Array
|
|
21
|
-
expect(targets.first).to be_a Twitter::User
|
|
22
|
-
end
|
|
23
|
-
it "is empty when not set" do
|
|
24
|
-
targets = Twitter::Action::Follow.new.targets
|
|
25
|
-
expect(targets).to be_empty
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::Action::ListMemberAdded do
|
|
4
|
-
|
|
5
|
-
describe "#sources" do
|
|
6
|
-
it "returns a collection of users who added a user to a list" do
|
|
7
|
-
sources = Twitter::Action::ListMemberAdded.new(:sources => [{:id => 7505382}]).sources
|
|
8
|
-
expect(sources).to be_an Array
|
|
9
|
-
expect(sources.first).to be_a Twitter::User
|
|
10
|
-
end
|
|
11
|
-
it "is empty when not set" do
|
|
12
|
-
sources = Twitter::Action::ListMemberAdded.new.sources
|
|
13
|
-
expect(sources).to be_empty
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe "#target_objects" do
|
|
18
|
-
it "returns a collection of lists that were added to" do
|
|
19
|
-
targets = Twitter::Action::ListMemberAdded.new(:target_objects => [{:id => 8863586}]).target_objects
|
|
20
|
-
expect(targets).to be_an Array
|
|
21
|
-
expect(targets.first).to be_a Twitter::List
|
|
22
|
-
end
|
|
23
|
-
it "is empty when not set" do
|
|
24
|
-
targets = Twitter::Action::ListMemberAdded.new.target_objects
|
|
25
|
-
expect(targets).to be_empty
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
describe "#targets" do
|
|
30
|
-
it "returns a collection of users who were added to a list" do
|
|
31
|
-
targets = Twitter::Action::ListMemberAdded.new(:targets => [{:id => 7505382}]).targets
|
|
32
|
-
expect(targets).to be_an Array
|
|
33
|
-
expect(targets.first).to be_a Twitter::User
|
|
34
|
-
end
|
|
35
|
-
it "is empty when not set" do
|
|
36
|
-
targets = Twitter::Action::ListMemberAdded.new.targets
|
|
37
|
-
expect(targets).to be_empty
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::Action::Mention do
|
|
4
|
-
|
|
5
|
-
describe "#sources" do
|
|
6
|
-
it "returns a collection of users who mentioned a user" do
|
|
7
|
-
sources = Twitter::Action::Mention.new(:sources => [{:id => 7505382}]).sources
|
|
8
|
-
expect(sources).to be_an Array
|
|
9
|
-
expect(sources.first).to be_a Twitter::User
|
|
10
|
-
end
|
|
11
|
-
it "is empty when not set" do
|
|
12
|
-
sources = Twitter::Action::Mention.new.sources
|
|
13
|
-
expect(sources).to be_empty
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe "#source" do
|
|
18
|
-
it "returns the user who mentioned a user" do
|
|
19
|
-
source = Twitter::Action::Mention.new(:sources => [{:id => 7505382}]).source
|
|
20
|
-
expect(source).to be_a Twitter::User
|
|
21
|
-
end
|
|
22
|
-
it "returns nil when not set" do
|
|
23
|
-
source = Twitter::Action::Mention.new.source
|
|
24
|
-
expect(source).to be_nil
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
describe "#target_objects" do
|
|
29
|
-
it "returns a collection of Tweets that mention a user" do
|
|
30
|
-
targets = Twitter::Action::Mention.new(:target_objects => [{:id => 25938088801}]).target_objects
|
|
31
|
-
expect(targets).to be_an Array
|
|
32
|
-
expect(targets.first).to be_a Twitter::Tweet
|
|
33
|
-
end
|
|
34
|
-
it "is empty when not set" do
|
|
35
|
-
targets = Twitter::Action::Mention.new.target_objects
|
|
36
|
-
expect(targets).to be_empty
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
describe "#targets" do
|
|
41
|
-
it "returns a collection containing the mentioned user" do
|
|
42
|
-
targets = Twitter::Action::Mention.new(:targets => [{:id => 7505382}]).targets
|
|
43
|
-
expect(targets).to be_an Array
|
|
44
|
-
expect(targets.first).to be_a Twitter::User
|
|
45
|
-
end
|
|
46
|
-
it "is empty when not set" do
|
|
47
|
-
targets = Twitter::Action::Mention.new.targets
|
|
48
|
-
expect(targets).to be_empty
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::Action::Reply do
|
|
4
|
-
|
|
5
|
-
describe "#sources" do
|
|
6
|
-
it "returns a collection of users who replied to a user" do
|
|
7
|
-
sources = Twitter::Action::Reply.new(:sources => [{:id => 7505382}]).sources
|
|
8
|
-
expect(sources).to be_an Array
|
|
9
|
-
expect(sources.first).to be_a Twitter::User
|
|
10
|
-
end
|
|
11
|
-
it "is empty when not set" do
|
|
12
|
-
sources = Twitter::Action::Reply.new.sources
|
|
13
|
-
expect(sources).to be_empty
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe "#target_objects" do
|
|
18
|
-
it "returns a collection of Tweets that reply to a user" do
|
|
19
|
-
targets = Twitter::Action::Reply.new(:target_objects => [{:id => 25938088801}]).target_objects
|
|
20
|
-
expect(targets).to be_an Array
|
|
21
|
-
expect(targets.first).to be_a Twitter::Tweet
|
|
22
|
-
end
|
|
23
|
-
it "is empty when not set" do
|
|
24
|
-
targets = Twitter::Action::Reply.new.target_objects
|
|
25
|
-
expect(targets).to be_empty
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
describe "#targets" do
|
|
30
|
-
it "returns a collection that contains the replied-to status" do
|
|
31
|
-
targets = Twitter::Action::Reply.new(:targets => [{:id => 25938088801}]).targets
|
|
32
|
-
expect(targets).to be_an Array
|
|
33
|
-
expect(targets.first).to be_a Twitter::Tweet
|
|
34
|
-
end
|
|
35
|
-
it "is empty when not set" do
|
|
36
|
-
targets = Twitter::Action::Reply.new.targets
|
|
37
|
-
expect(targets).to be_empty
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::Action::Retweet do
|
|
4
|
-
|
|
5
|
-
describe "#sources" do
|
|
6
|
-
it "returns a collection of users who retweeted a user" do
|
|
7
|
-
sources = Twitter::Action::Retweet.new(:sources => [{:id => 7505382}]).sources
|
|
8
|
-
expect(sources).to be_an Array
|
|
9
|
-
expect(sources.first).to be_a Twitter::User
|
|
10
|
-
end
|
|
11
|
-
it "is empty when not set" do
|
|
12
|
-
sources = Twitter::Action::Retweet.new.sources
|
|
13
|
-
expect(sources).to be_empty
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe "#target_objects" do
|
|
18
|
-
it "returns a collection of retweets" do
|
|
19
|
-
targets = Twitter::Action::Retweet.new(:target_objects => [{:id => 25938088801}]).target_objects
|
|
20
|
-
expect(targets).to be_an Array
|
|
21
|
-
expect(targets.first).to be_a Twitter::Tweet
|
|
22
|
-
end
|
|
23
|
-
it "is empty when not set" do
|
|
24
|
-
targets = Twitter::Action::Retweet.new.target_objects
|
|
25
|
-
expect(targets).to be_empty
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
describe "#targets" do
|
|
30
|
-
it "returns a collection containing the retweeted user" do
|
|
31
|
-
targets = Twitter::Action::Retweet.new(:targets => [{:id => 7505382}]).targets
|
|
32
|
-
expect(targets).to be_an Array
|
|
33
|
-
expect(targets.first).to be_a Twitter::User
|
|
34
|
-
end
|
|
35
|
-
it "is empty when not set" do
|
|
36
|
-
targets = Twitter::Action::Retweet.new.targets
|
|
37
|
-
expect(targets).to be_empty
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::ActionFactory do
|
|
4
|
-
|
|
5
|
-
describe ".new" do
|
|
6
|
-
it "generates a Favorite" do
|
|
7
|
-
action = Twitter::ActionFactory.fetch_or_new(:action => 'favorite')
|
|
8
|
-
expect(action).to be_a Twitter::Action::Favorite
|
|
9
|
-
end
|
|
10
|
-
it "generates a Follow" do
|
|
11
|
-
action = Twitter::ActionFactory.fetch_or_new(:action => 'follow')
|
|
12
|
-
expect(action).to be_a Twitter::Action::Follow
|
|
13
|
-
end
|
|
14
|
-
it "generates a ListMemberAdded" do
|
|
15
|
-
action = Twitter::ActionFactory.fetch_or_new(:action => 'list_member_added')
|
|
16
|
-
expect(action).to be_a Twitter::Action::ListMemberAdded
|
|
17
|
-
end
|
|
18
|
-
it "generates a Mention" do
|
|
19
|
-
action = Twitter::ActionFactory.fetch_or_new(:action => 'mention')
|
|
20
|
-
expect(action).to be_a Twitter::Action::Mention
|
|
21
|
-
end
|
|
22
|
-
it "generates a Reply" do
|
|
23
|
-
action = Twitter::ActionFactory.fetch_or_new(:action => 'reply')
|
|
24
|
-
expect(action).to be_a Twitter::Action::Reply
|
|
25
|
-
end
|
|
26
|
-
it "generates a Retweet" do
|
|
27
|
-
action = Twitter::ActionFactory.fetch_or_new(:action => 'retweet')
|
|
28
|
-
expect(action).to be_a Twitter::Action::Retweet
|
|
29
|
-
end
|
|
30
|
-
it "raises an ArgumentError when action is not specified" do
|
|
31
|
-
expect{Twitter::ActionFactory.fetch_or_new}.to raise_error ArgumentError
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
end
|
data/spec/twitter/action_spec.rb
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::Action do
|
|
4
|
-
|
|
5
|
-
describe "#created_at" do
|
|
6
|
-
it "returns a Time when created_at is set" do
|
|
7
|
-
user = Twitter::User.new(:id => 7505382, :created_at => "Mon Jul 16 12:59:01 +0000 2007")
|
|
8
|
-
expect(user.created_at).to be_a Time
|
|
9
|
-
end
|
|
10
|
-
it "returns nil when created_at is not set" do
|
|
11
|
-
user = Twitter::User.new(:id => 7505382)
|
|
12
|
-
expect(user.created_at).to be_nil
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
end
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
require 'helper'
|
|
2
|
-
|
|
3
|
-
describe Twitter::API::Tweets do
|
|
4
|
-
|
|
5
|
-
before do
|
|
6
|
-
@client = Twitter::Client.new
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
describe "#retweets" do
|
|
10
|
-
before do
|
|
11
|
-
stub_get("/1.1/statuses/retweets/28561922516.json").to_return(:body => fixture("retweets.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
12
|
-
end
|
|
13
|
-
it "requests the correct resource" do
|
|
14
|
-
@client.retweets(28561922516)
|
|
15
|
-
expect(a_get("/1.1/statuses/retweets/28561922516.json")).to have_been_made
|
|
16
|
-
end
|
|
17
|
-
it "returns up to 100 of the first retweets of a given tweet" do
|
|
18
|
-
tweets = @client.retweets(28561922516)
|
|
19
|
-
expect(tweets).to be_an Array
|
|
20
|
-
expect(tweets.first).to be_a Twitter::Tweet
|
|
21
|
-
expect(tweets.first.text).to eq "RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush."
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
describe "#retweeters_of" do
|
|
26
|
-
context "with ids_only passed" do
|
|
27
|
-
before do
|
|
28
|
-
stub_get("/1.1/statuses/retweets/28561922516.json").to_return(:body => fixture("retweets.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
29
|
-
end
|
|
30
|
-
it "requests the correct resource" do
|
|
31
|
-
@client.retweeters_of(28561922516, :ids_only => true)
|
|
32
|
-
expect(a_get("/1.1/statuses/retweets/28561922516.json")).to have_been_made
|
|
33
|
-
end
|
|
34
|
-
it "returns an array of numeric user IDs of retweeters of a Tweet" do
|
|
35
|
-
ids = @client.retweeters_of(28561922516, :ids_only => true)
|
|
36
|
-
expect(ids).to be_an Array
|
|
37
|
-
expect(ids.first).to eq 7505382
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
context "without ids_only passed" do
|
|
41
|
-
before do
|
|
42
|
-
stub_get("/1.1/statuses/retweets/28561922516.json").to_return(:body => fixture("retweets.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
43
|
-
end
|
|
44
|
-
it "requests the correct resource" do
|
|
45
|
-
@client.retweeters_of(28561922516)
|
|
46
|
-
expect(a_get("/1.1/statuses/retweets/28561922516.json")).to have_been_made
|
|
47
|
-
end
|
|
48
|
-
it "returns an array of user of retweeters of a Tweet" do
|
|
49
|
-
users = @client.retweeters_of(28561922516)
|
|
50
|
-
expect(users).to be_an Array
|
|
51
|
-
expect(users.first).to be_a Twitter::User
|
|
52
|
-
expect(users.first.id).to eq 7505382
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
describe "#status" do
|
|
58
|
-
before do
|
|
59
|
-
stub_get("/1.1/statuses/show/25938088801.json").to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
60
|
-
end
|
|
61
|
-
it "requests the correct resource" do
|
|
62
|
-
@client.status(25938088801)
|
|
63
|
-
expect(a_get("/1.1/statuses/show/25938088801.json")).to have_been_made
|
|
64
|
-
end
|
|
65
|
-
it "returns a Tweet" do
|
|
66
|
-
tweet = @client.status(25938088801)
|
|
67
|
-
expect(tweet).to be_a Twitter::Tweet
|
|
68
|
-
expect(tweet.text).to eq "The problem with your code is that it's doing exactly what you told it to do."
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
describe "#statuses" do
|
|
73
|
-
before do
|
|
74
|
-
stub_get("/1.1/statuses/show/25938088801.json").to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
75
|
-
end
|
|
76
|
-
it "requests the correct resource" do
|
|
77
|
-
@client.statuses(25938088801)
|
|
78
|
-
expect(a_get("/1.1/statuses/show/25938088801.json")).to have_been_made
|
|
79
|
-
end
|
|
80
|
-
it "returns an array of Tweets" do
|
|
81
|
-
tweets = @client.statuses(25938088801)
|
|
82
|
-
expect(tweets).to be_an Array
|
|
83
|
-
expect(tweets.first).to be_a Twitter::Tweet
|
|
84
|
-
expect(tweets.first.text).to eq "The problem with your code is that it's doing exactly what you told it to do."
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
describe "#status_destroy" do
|
|
89
|
-
before do
|
|
90
|
-
stub_post("/1.1/statuses/destroy/25938088801.json").to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
91
|
-
end
|
|
92
|
-
it "requests the correct resource" do
|
|
93
|
-
@client.status_destroy(25938088801)
|
|
94
|
-
expect(a_post("/1.1/statuses/destroy/25938088801.json")).to have_been_made
|
|
95
|
-
end
|
|
96
|
-
it "returns an array of Tweets" do
|
|
97
|
-
tweets = @client.status_destroy(25938088801)
|
|
98
|
-
expect(tweets).to be_an Array
|
|
99
|
-
expect(tweets.first).to be_a Twitter::Tweet
|
|
100
|
-
expect(tweets.first.text).to eq "The problem with your code is that it's doing exactly what you told it to do."
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
describe "#tweet" do
|
|
105
|
-
before do
|
|
106
|
-
stub_post("/1.1/statuses/update.json").with(:body => {:status => "The problem with your code is that it's doing exactly what you told it to do."}).to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
107
|
-
end
|
|
108
|
-
it "requests the correct resource" do
|
|
109
|
-
@client.update("The problem with your code is that it's doing exactly what you told it to do.")
|
|
110
|
-
expect(a_post("/1.1/statuses/update.json").with(:body => {:status => "The problem with your code is that it's doing exactly what you told it to do."})).to have_been_made
|
|
111
|
-
end
|
|
112
|
-
it "returns a Tweet" do
|
|
113
|
-
tweet = @client.update("The problem with your code is that it's doing exactly what you told it to do.")
|
|
114
|
-
expect(tweet).to be_a Twitter::Tweet
|
|
115
|
-
expect(tweet.text).to eq "The problem with your code is that it's doing exactly what you told it to do."
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
describe "#retweet" do
|
|
120
|
-
before do
|
|
121
|
-
stub_post("/1.1/statuses/retweet/28561922516.json").to_return(:body => fixture("retweet.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
122
|
-
end
|
|
123
|
-
it "requests the correct resource" do
|
|
124
|
-
@client.retweet(28561922516)
|
|
125
|
-
expect(a_post("/1.1/statuses/retweet/28561922516.json")).to have_been_made
|
|
126
|
-
end
|
|
127
|
-
it "returns an array of Tweets with retweet details embedded" do
|
|
128
|
-
tweets = @client.retweet(28561922516)
|
|
129
|
-
expect(tweets).to be_an Array
|
|
130
|
-
expect(tweets.first).to be_a Twitter::Tweet
|
|
131
|
-
expect(tweets.first.text).to eq "As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush."
|
|
132
|
-
expect(tweets.first.retweeted_tweet.text).to eq "RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush."
|
|
133
|
-
expect(tweets.first.retweeted_tweet.id).not_to eq tweets.first.id
|
|
134
|
-
end
|
|
135
|
-
context "already retweeted" do
|
|
136
|
-
before do
|
|
137
|
-
stub_post("/1.1/statuses/retweet/28561922516.json").to_return(:status => 403, :body => fixture("already_retweeted.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
138
|
-
end
|
|
139
|
-
it "does not raise an error" do
|
|
140
|
-
expect{@client.retweet(28561922516)}.not_to raise_error
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
describe "#retweet!" do
|
|
146
|
-
before do
|
|
147
|
-
stub_post("/1.1/statuses/retweet/28561922516.json").to_return(:body => fixture("retweet.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
148
|
-
end
|
|
149
|
-
it "requests the correct resource" do
|
|
150
|
-
@client.retweet!(28561922516)
|
|
151
|
-
expect(a_post("/1.1/statuses/retweet/28561922516.json")).to have_been_made
|
|
152
|
-
end
|
|
153
|
-
it "returns an array of Tweets with retweet details embedded" do
|
|
154
|
-
tweets = @client.retweet!(28561922516)
|
|
155
|
-
expect(tweets).to be_an Array
|
|
156
|
-
expect(tweets.first).to be_a Twitter::Tweet
|
|
157
|
-
expect(tweets.first.text).to eq "As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush."
|
|
158
|
-
expect(tweets.first.retweeted_tweet.text).to eq "RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush."
|
|
159
|
-
expect(tweets.first.retweeted_tweet.id).not_to eq tweets.first.id
|
|
160
|
-
end
|
|
161
|
-
context "fobidden" do
|
|
162
|
-
before do
|
|
163
|
-
stub_post("/1.1/statuses/retweet/28561922516.json").to_return(:status => 403, :headers => {:content_type => "application/json; charset=utf-8"})
|
|
164
|
-
end
|
|
165
|
-
it "raises a Forbidden error" do
|
|
166
|
-
expect{@client.retweet!(28561922516)}.to raise_error Twitter::Error::Forbidden
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
context "already retweeted" do
|
|
170
|
-
before do
|
|
171
|
-
stub_post("/1.1/statuses/retweet/28561922516.json").to_return(:status => 403, :body => fixture("already_retweeted.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
172
|
-
end
|
|
173
|
-
it "raises an AlreadyRetweeted error" do
|
|
174
|
-
expect{@client.retweet!(28561922516)}.to raise_error Twitter::Error::AlreadyRetweeted
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
describe "#update_with_media" do
|
|
180
|
-
before do
|
|
181
|
-
stub_post("/1.1/statuses/update_with_media.json").to_return(:body => fixture("status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
182
|
-
end
|
|
183
|
-
context "a gif image" do
|
|
184
|
-
it "requests the correct resource" do
|
|
185
|
-
@client.update_with_media("The problem with your code is that it's doing exactly what you told it to do.", fixture("pbjt.gif"))
|
|
186
|
-
expect(a_post("/1.1/statuses/update_with_media.json")).to have_been_made
|
|
187
|
-
end
|
|
188
|
-
it "returns a Tweet" do
|
|
189
|
-
tweet = @client.update_with_media("The problem with your code is that it's doing exactly what you told it to do.", fixture("pbjt.gif"))
|
|
190
|
-
expect(tweet).to be_a Twitter::Tweet
|
|
191
|
-
expect(tweet.text).to eq "The problem with your code is that it's doing exactly what you told it to do."
|
|
192
|
-
end
|
|
193
|
-
end
|
|
194
|
-
context "a jpe image" do
|
|
195
|
-
it "requests the correct resource" do
|
|
196
|
-
@client.update_with_media("You always have options", fixture("wildcomet2.jpe"))
|
|
197
|
-
expect(a_post("/1.1/statuses/update_with_media.json")).to have_been_made
|
|
198
|
-
end
|
|
199
|
-
end
|
|
200
|
-
context "a jpeg image" do
|
|
201
|
-
it "requests the correct resource" do
|
|
202
|
-
@client.update_with_media("You always have options", fixture("me.jpeg"))
|
|
203
|
-
expect(a_post("/1.1/statuses/update_with_media.json")).to have_been_made
|
|
204
|
-
end
|
|
205
|
-
end
|
|
206
|
-
context "a png image" do
|
|
207
|
-
it "requests the correct resource" do
|
|
208
|
-
@client.update_with_media("You always have options", fixture("we_concept_bg2.png"))
|
|
209
|
-
expect(a_post("/1.1/statuses/update_with_media.json")).to have_been_made
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
|
-
context "a Tempfile" do
|
|
213
|
-
it "requests the correct resource" do
|
|
214
|
-
@client.update_with_media("You always have options", Tempfile.new("tmp"))
|
|
215
|
-
expect(a_post("/1.1/statuses/update_with_media.json")).to have_been_made
|
|
216
|
-
end
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
describe "#oembed" do
|
|
221
|
-
before do
|
|
222
|
-
stub_get("/1.1/statuses/oembed.json").with(:query => {:id => "25938088801"}).to_return(:body => fixture("oembed.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
223
|
-
stub_get("/1.1/statuses/oembed.json").with(:query => {:url => "https://twitter.com/sferik/status/25938088801"}).to_return(:body => fixture("oembed.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
224
|
-
end
|
|
225
|
-
it "requests the correct resource" do
|
|
226
|
-
@client.oembed(25938088801)
|
|
227
|
-
expect(a_get("/1.1/statuses/oembed.json").with(:query => {:id => "25938088801"})).to have_been_made
|
|
228
|
-
end
|
|
229
|
-
it "requests the correct resource when a URL is given" do
|
|
230
|
-
@client.oembed("https://twitter.com/sferik/status/25938088801")
|
|
231
|
-
expect(a_get("/1.1/statuses/oembed.json").with(:query => {:url => "https://twitter.com/sferik/status/25938088801"}))
|
|
232
|
-
end
|
|
233
|
-
it "returns an array of OEmbed instances" do
|
|
234
|
-
oembed = @client.oembed(25938088801)
|
|
235
|
-
expect(oembed).to be_a Twitter::OEmbed
|
|
236
|
-
end
|
|
237
|
-
end
|
|
238
|
-
|
|
239
|
-
describe "#oembeds" do
|
|
240
|
-
before do
|
|
241
|
-
stub_get("/1.1/statuses/oembed.json").with(:query => {:id => "25938088801"}).to_return(:body => fixture("oembed.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
242
|
-
stub_get("/1.1/statuses/oembed.json").with(:query => {:url => "https://twitter.com/sferik/status/25938088801"}).to_return(:body => fixture("oembed.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
243
|
-
end
|
|
244
|
-
it "requests the correct resource" do
|
|
245
|
-
@client.oembeds(25938088801)
|
|
246
|
-
expect(a_get("/1.1/statuses/oembed.json").with(:query => {:id => "25938088801"})).to have_been_made
|
|
247
|
-
end
|
|
248
|
-
it "requests the correct resource when a URL is given" do
|
|
249
|
-
@client.oembeds("https://twitter.com/sferik/status/25938088801")
|
|
250
|
-
expect(a_get("/1.1/statuses/oembed.json").with(:query => {:url => "https://twitter.com/sferik/status/25938088801"})).to have_been_made
|
|
251
|
-
end
|
|
252
|
-
it "returns an array of OEmbed instances" do
|
|
253
|
-
oembeds = @client.oembeds(25938088801)
|
|
254
|
-
expect(oembeds).to be_an Array
|
|
255
|
-
expect(oembeds.first).to be_a Twitter::OEmbed
|
|
256
|
-
end
|
|
257
|
-
end
|
|
258
|
-
|
|
259
|
-
describe "#retweeters_ids" do
|
|
260
|
-
before do
|
|
261
|
-
stub_get("/1.1/statuses/retweeters/ids.json").with(:query => {:id => "25938088801", :cursor => "-1"}).to_return(:body => fixture("ids_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
262
|
-
end
|
|
263
|
-
it "requests the correct resource" do
|
|
264
|
-
@client.retweeters_ids(25938088801)
|
|
265
|
-
expect(a_get("/1.1/statuses/retweeters/ids.json").with(:query => {:id => "25938088801", :cursor => "-1"})).to have_been_made
|
|
266
|
-
end
|
|
267
|
-
it "returns a collection of user IDs belonging to users who have retweeted the specified Tweet" do
|
|
268
|
-
retweeters_ids = @client.retweeters_ids(25938088801)
|
|
269
|
-
expect(retweeters_ids).to be_a Twitter::Cursor
|
|
270
|
-
expect(retweeters_ids.ids).to be_an Array
|
|
271
|
-
expect(retweeters_ids.ids.first).to eq 14100886
|
|
272
|
-
end
|
|
273
|
-
context "with all" do
|
|
274
|
-
before do
|
|
275
|
-
stub_get("/1.1/statuses/retweeters/ids.json").with(:query => {:id => "25938088801", :cursor => "1305102810874389703"}).to_return(:body => fixture("ids_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
|
276
|
-
end
|
|
277
|
-
it "requests the correct resource" do
|
|
278
|
-
@client.retweeters_ids(25938088801).all
|
|
279
|
-
expect(a_get("/1.1/statuses/retweeters/ids.json").with(:query => {:id => "25938088801", :cursor => "-1"})).to have_been_made
|
|
280
|
-
expect(a_get("/1.1/statuses/retweeters/ids.json").with(:query => {:id => "25938088801", :cursor => "1305102810874389703"})).to have_been_made
|
|
281
|
-
end
|
|
282
|
-
end
|
|
283
|
-
end
|
|
284
|
-
|
|
285
|
-
end
|