Sha256: 511afbe9cb811af7a38538bc7255c07d2085349453dead42bdac3e21f46561c0

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

require 'test_helper'

class TimelinesTest < Totter::TestCase
  def test_global
    VCR.use_cassette 'timelines/global' do
      response = Totter.global_timeline(limit: 15)
      assert_equal 15, response.items.length
      assert_equal 'timeline-global', response.pusher_channel
    end
  end

  def test_hashtags
    VCR.use_cassette 'timelines/hashtags' do
      client = local_client
      response = local_client.hashtag_timeline('test')
      assert_equal 1, response.items.length
      assert_equal 'timeline-hashtag-test', response.pusher_channel
    end
  end

  def test_stickers
    VCR.use_cassette 'timelines/stickers' do
      client = local_client
      response = local_client.sticker_timeline('test')
      assert_equal 1, response.items.length
      assert_equal 'timeline-sticker-test', response.pusher_channel
    end
  end

  def test_search
    VCR.use_cassette 'timelines/search' do
      client = local_client
      response = local_client.search_timeline('bacon')
      assert_equal 2, response.items.length
    end
  end

  def test_flagged
    VCR.use_cassette 'timelines/flagged' do
      client = local_client
      response = local_client.flagged_timeline
      assert_equal 1, response.items.length
      assert_equal 'timeline-flagged', response.pusher_channel
    end
  end

  def test_user
    VCR.use_cassette 'timelines/user' do
      client = local_client
      response = local_client.user_timeline(4)
      assert_equal 0, response.items.length
      assert_equal 'timeline-user-4', response.pusher_channel
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
totter-0.3.1 test/totter/client/timelines_test.rb