Sha256: 18529613fe3392e4aef25987e4166429f898f30b81d8a884a39cfab9d6a4088b

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

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

class TagSearchPageTest < ActiveSupport::TestCase
  
  fixtures :pages, :meta_tags, :taggings, :page_parts
  
  def setup
    @page = pages(:tags_page)
    @page.request = ActionController::TestRequest.new
    @page.response = ActionController::TestResponse.new
  end
  
  def test_title_gets_set_ok
    @page.request.request_parameters = {:tag => "foo"}
    @page.render
    assert_equal "Tagged with foo", @page.title
  end
  
  def test_no_title_means_no_title_change
    @page.render
    assert_equal "Tags Page", @page.title
  end
  
  def test_page_should_show_posts_tagged_with_tag
    @page.request.request_parameters = {:tag => "lorem"}
    output = @page.render
    assert_match /These pages are tagged with "lorem"/, output
    assert_match /Ruby Home Page/, output
    assert_match /Documentation/, output
  end
  
  def test_resulting_pages_should_be_sorted
    @page.request.request_parameters = {:tag => "lorem"}
    output = @page.render
    assert_match /Documentation.*Ruby Home Page/, output
  end
  
  def test_unknown_tag_should_say_so
    @page.request.request_parameters = {:tag => "foobarbar"}
    output = @page.render
    assert_match /No pages tagged with "foobarbar"/, output
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radiant-taginator-extension-2.0.beta1 test/functional/tag_search_page_test.rb