spec/twitter/api/undocumented_spec.rb in twitter-4.4.1 vs spec/twitter/api/undocumented_spec.rb in twitter-4.4.2

- old
+ new

@@ -47,11 +47,40 @@ following_followers_of = @client.following_followers_of("sferik") expect(following_followers_of).to be_a Twitter::Cursor expect(following_followers_of.users).to be_an Array expect(following_followers_of.users.first).to be_a Twitter::User end + context "with all" do + before do + stub_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"}) + end + it "requests the correct resource" do + @client.following_followers_of("sferik").all + expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made + expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"})).to have_been_made + end + end end + context "with a user ID passed" do + before do + stub_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :user_id => "7505382"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"}) + end + it "requests the correct resource" do + @client.following_followers_of(7505382) + expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made + end + context "with all" do + before do + stub_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :user_id => "7505382"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"}) + end + it "requests the correct resource" do + @client.following_followers_of(7505382).all + expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :user_id => "7505382"})).to have_been_made + expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :user_id => "7505382"})).to have_been_made + end + end + end context "without arguments passed" do before do stub_get("/1.1/account/verify_credentials.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"}) stub_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"}).to_return(:body => fixture("users_list.json"), :headers => {:content_type => "application/json; charset=utf-8"}) end @@ -63,9 +92,19 @@ it "returns an array of numeric IDs for every user following the specified user" do following_followers_of = @client.following_followers_of expect(following_followers_of).to be_a Twitter::Cursor expect(following_followers_of.users).to be_an Array expect(following_followers_of.users.first).to be_a Twitter::User + end + context "with all" do + before do + stub_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"}).to_return(:body => fixture("users_list2.json"), :headers => {:content_type => "application/json; charset=utf-8"}) + end + it "requests the correct resource" do + @client.following_followers_of.all + expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "-1", :screen_name => "sferik"})).to have_been_made + expect(a_get("/users/following_followers_of.json").with(:query => {:cursor => "1322801608223717003", :screen_name => "sferik"})).to have_been_made + end end end end describe "#status_activity" do