Sha256: 33ad031864106ada5c4f0207aa91c50864aa986d3299003da8284a9e87bfb345

Contents?: true

Size: 903 Bytes

Versions: 8

Compression:

Stored size: 903 Bytes

Contents

require 'helper'

describe Twitter::REST::API::SpamReporting do

  before do
    @client = Twitter::REST::Client.new(:consumer_key => 'CK', :consumer_secret => 'CS', :access_token => 'AT', :access_token_secret => 'AS')
  end

  describe '#report_spam' do
    before do
      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/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')
      expect(users).to be_an Array
      expect(users.first).to be_a Twitter::User
      expect(users.first.id).to eq(7_505_382)
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
twitter-5.6.0 spec/twitter/rest/api/spam_reporting_spec.rb
twitter-5.5.1 spec/twitter/rest/api/spam_reporting_spec.rb
twitter-5.5.0 spec/twitter/rest/api/spam_reporting_spec.rb
twitter-5.4.1 spec/twitter/rest/api/spam_reporting_spec.rb
twitter-5.4.0 spec/twitter/rest/api/spam_reporting_spec.rb
twitter-5.3.1 spec/twitter/rest/api/spam_reporting_spec.rb
twitter-5.3.0 spec/twitter/rest/api/spam_reporting_spec.rb
twitter-5.2.0 spec/twitter/rest/api/spam_reporting_spec.rb