This commit is contained in:
Alexey Verkhovsky 2005-01-30 03:17:02 +00:00
parent 22a8ebb86d
commit a0303d1eea
3 changed files with 50 additions and 8 deletions

View file

@ -477,7 +477,9 @@ class WikiControllerTest < Test::Unit::TestCase
def test_search
setup_wiki_with_three_pages
process 'search', 'web' => 'wiki1', 'query' => '\s[A-Z]ak'
r = process 'search', 'web' => 'wiki1', 'query' => '\s[A-Z]ak'
assert_redirected_to :action => 'show', :id => 'Oak'
end
@ -489,6 +491,18 @@ class WikiControllerTest < Test::Unit::TestCase
assert_success
assert_equal 'All about', r.template_objects['query']
assert_equal [@elephant, @oak], r.template_objects['results']
assert_equal [], r.template_objects['title_results']
end
def test_search_by_content_and_title
setup_wiki_with_three_pages
r = process 'search', 'web' => 'wiki1', 'query' => '(Oak|Elephant)'
assert_success
assert_equal '(Oak|Elephant)', r.template_objects['query']
assert_equal [@elephant, @oak], r.template_objects['results']
assert_equal [@elephant, @oak], r.template_objects['title_results']
end
def test_search_zero_results
@ -498,7 +512,10 @@ class WikiControllerTest < Test::Unit::TestCase
assert_success
assert_equal [], r.template_objects['results']
assert_equal [], r.template_objects['title_results']
end
def test_show_page