Sha256: be86a39b335f569892cbf78d565b965fc1dff39b851cad4493d815f7829d5891

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

require File.dirname(__FILE__) + '/test_helper.rb'
require "test/unit"
require 'pit'
require 'pp'
$KCODE='u'
class Tumblr4rDashboardTest < Test::Unit::TestCase
  include Tumblr4r
  DASHBOARD_TEST_HOST = "tumblr4r-dashboard-test.tumblr.com"
  TOTAL_COUNT = 123
  REGULAR_COUNT = 6
  QUOTE_COUNT = 103
  PHOTO_COUNT = 2

  def setup
    Site.default_log_level = Logger::DEBUG
    auth_info = Pit.get("tumblr4r-dashbard-test",
                             :require => {"email" => "required email",
                             "password" => "required password"})
    @site = Site.new(DASHBOARD_TEST_HOST,
                     auth_info["email"],
                     auth_info["password"])
  end

  def teardown
  end
=begin
  def test_find_all
    posts = @site.dashboard
    pp posts
    assert_equal TOTAL_COUNT, posts.size
  end
=end
  def test_type
    posts = @site.dashboard(:type => "regular")
    assert_equal REGULAR_COUNT, posts.size
    assert posts.all?{|p| p.type == Tumblr4r::POST_TYPE::REGULAR }

    posts = @site.dashboard(:type => "quote")
    assert_equal QUOTE_COUNT, posts.size
    assert posts.all?{|p| p.type == Tumblr4r::POST_TYPE::QUOTE }

    posts = @site.dashboard(:type => "photo")
    assert_equal PHOTO_COUNT, posts.size
    assert posts.all?{|p| p.type == Tumblr4r::POST_TYPE::PHOTO }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tumblr4r-0.8.1 test/tumblr4r_dashboard_test.rb
tumblr4r-0.8.0 test/tumblr4r_dashboard_test.rb