Sha256: f1c703d17765f42f81c84f74557c4140229bf2c2c784ea7c97d89b777243c5ef

Contents?: true

Size: 999 Bytes

Versions: 5

Compression:

Stored size: 999 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class AmazonSidebarTest < Test::Unit::TestCase
  fixtures :sidebars

  def test_creation
    assert_kind_of Sidebar, AmazonSidebar.new
  end

  def test_default_title
    assert_equal 'Cited books',     AmazonSidebar.new.title
  end

  def test_default_associate_id
    assert_equal 'justasummary-20', AmazonSidebar.new.associate_id
  end

  def test_default_maxlinks
    assert_equal 4,                 AmazonSidebar.new.maxlinks
  end

  def test_description
    assert_equal "Adds sidebar links to any amazon books linked in the body of the page",
      AmazonSidebar.description
  end

  def test_initialization_with_hash
    sb = AmazonSidebar.new(:title => 'Books',
                           :associate_id => 'justasummary-21',
                           :maxlinks => 3)
    assert sb
    assert_equal 'Books',           sb.title
    assert_equal 'justasummary-21', sb.associate_id
    assert_equal 3,                 sb.maxlinks
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
typo-4.1.1 test/unit/amazon_sidebar_test.rb
typo-4.1 test/unit/amazon_sidebar_test.rb
typo-5.0.1 test/unit/amazon_sidebar_test.rb
typo-5.0.2 test/unit/amazon_sidebar_test.rb
typo-5.0 test/unit/amazon_sidebar_test.rb