Sha256: 967df7e7e8fb9e8f3ea854f14d75186f0299f26b0f51f43e0fc88e0abcaa2080

Contents?: true

Size: 759 Bytes

Versions: 3

Compression:

Stored size: 759 Bytes

Contents

require 'helper'

describe Twitter::API do

  before do
    @client = Twitter::Client.new
  end

  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"})
    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
    end
    it "returns an array of users" do
      users = @client.report_spam("sferik")
      expect(users).to be_an Array
      expect(users.first).to be_a Twitter::User
      expect(users.first.id).to eq 7505382
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twitter-4.2.0 spec/twitter/api/report_spam_spec.rb
twitter-4.1.2 spec/twitter/api/report_spam_spec.rb
twitter-4.1.1 spec/twitter/api/report_spam_spec.rb