Sha256: f959a6e98a60ac9d32683696c4216bf3792310e9cc193c189d04dda717418183

Contents?: true

Size: 790 Bytes

Versions: 1

Compression:

Stored size: 790 Bytes

Contents

require 'streambot/base_test'

module StreamBot
  # the test for testing retweet functionality
  class TestRetweet < StreamBot::BaseTest
    # setup the test 
    def setup
      super
      @retweet = StreamBot::Retweet.new(@auth)
      stub_request(:post, "http://#{@auth[:username]}:#{@auth[:password]}@api.twitter.com/1/statuses/retweet/#{@id}.json").to_return(:body => 'content')
    end

    # teardown the test
    # nil all instance variables
    def teardown
      @id, @retweet = nil
    end

    # retweet 
    def test_retweet
      # no permission to access web!
      WebMock.disable_net_connect!
      # retweet the given id
      response = @retweet.retweet(@id)
      # assertion
      assert_not_nil(response)
      assert_equal('content', response.body)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
streambot-0.3.0 test/streambot/test_retweet.rb