Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Correct endpoint of report_spam API

/1.1/report_spam.json -> /1.1/users/report_spam.json
  • Loading branch information...
commit e59c0c4c31a9f7eed3d202c276628a3ea0df6d28 1 parent 02bf97e
@uasi uasi authored
View
2  lib/twitter/api/spam_reporting.rb
@@ -22,7 +22,7 @@ module SpamReporting
# @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects.
# @param options [Hash] A customizable set of options.
def report_spam(*args)
- threaded_users_from_response(:post, "/1.1/report_spam.json", args)
+ threaded_users_from_response(:post, "/1.1/users/report_spam.json", args)
end
end
View
4 spec/twitter/api/spam_reporting_spec.rb
@@ -8,11 +8,11 @@
describe "#report_spam" do
before do
- stub_post("/1.1/report_spam.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
+ stub_post("/1.1/users/report_spam.json").with(:body => {:screen_name => "sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.report_spam("sferik")
- expect(a_post("/1.1/report_spam.json").with(:body => {:screen_name => "sferik"})).to have_been_made
+ expect(a_post("/1.1/users/report_spam.json").with(:body => {:screen_name => "sferik"})).to have_been_made
end
it "returns an array of users" do
users = @client.report_spam("sferik")
Please sign in to comment.
Something went wrong with that request. Please try again.