Skip to content

Commit

Permalink
Correct endpoint of report_spam API
Browse files Browse the repository at this point in the history
/1.1/report_spam.json -> /1.1/users/report_spam.json
  • Loading branch information
uasi committed Nov 27, 2012
1 parent 02bf97e commit e59c0c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/twitter/api/spam_reporting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/twitter/api/spam_reporting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit e59c0c4

Please sign in to comment.