Sha256: a726a435c1c2fff9fa71817faa1c180d3eeeaf534881e7104f08bb8dfd1a61ce

Contents?: true

Size: 1.11 KB

Versions: 26

Compression:

Stored size: 1.11 KB

Contents

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

class ArchivePageTest < Test::Unit::TestCase
  fixtures :pages
  test_helper :pages

  def test_child_url
    child = pages(:article)
    assert_equal '/archive/2000/05/01/article/', child.url
  end

  def test_child_url__nil_published_at_date
    child = pages(:article_draft)
    assert_nil child.published_at
    assert_equal '/archive/' + Time.now.strftime('%Y/%m/%d') + '/draft/', child.url
  end

  def test_find__year_index
    expected = pages(:year_index)
    year_index = Page.find_by_url('/archive/2000/')
    assert_equal expected, year_index
  end
  def test_find__month_index
    expected = pages(:month_index)
    month_index = Page.find_by_url('/archive/2000/06/')
    assert_equal expected, month_index
  end
  def test_find__day_index
    expected = pages(:day_index)
    day_index = Page.find_by_url('/archive/2000/06/09/')
    assert_equal expected, day_index
  end
  
  # Extracted from other unit tests
  def test_find_by_url_with_archive
    @page = pages(:homepage)
    assert_equal pages(:article), @page.find_by_url('/archive/2000/05/01/article/')
  end

end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
radiantcms-couchrest_model-0.2.4 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.2.2 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.2.1 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.2 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.1.9 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.1.8 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.1.7 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.1.6 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.1.5 vendor/extensions/archive/test/unit/archive_page_test.rb
radiantcms-couchrest_model-0.1.4 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.7.2 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.9.1 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.8.2 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.9.0.rc2 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-rc-0.9.0 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.8.1 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.6.4 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.6.5.1 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.6.5 vendor/extensions/archive/test/unit/archive_page_test.rb
radiant-0.6.7 vendor/extensions/archive/test/unit/archive_page_test.rb