comparison test/unit/wiki_test.rb @ 1337:077b8890835a cannam

Merge from live branch
author Chris Cannam
date Thu, 20 Jun 2013 13:14:02 +0100
parents bb32da3bea34
children 4f746d8966dd 51364c0cd58f
comparison
equal deleted inserted replaced
1304:6137548ba453 1337:077b8890835a
1 # encoding: utf-8 1 # encoding: utf-8
2 # 2 #
3 # Redmine - project management software 3 # Redmine - project management software
4 # Copyright (C) 2006-2011 Jean-Philippe Lang 4 # Copyright (C) 2006-2012 Jean-Philippe Lang
5 # 5 #
6 # This program is free software; you can redistribute it and/or 6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License 7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2 8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version. 9 # of the License, or (at your option) any later version.
54 assert_equal page, wiki.find_page('Этика_менеджмента') 54 assert_equal page, wiki.find_page('Этика_менеджмента')
55 end 55 end
56 56
57 def test_find_page_with_backslashes 57 def test_find_page_with_backslashes
58 wiki = Wiki.find(1) 58 wiki = Wiki.find(1)
59 page = WikiPage.generate!(:wiki => wiki, :title => '2009\\02\\09') 59 page = WikiPage.create!(:wiki => wiki, :title => '2009\\02\\09')
60 assert_equal page, wiki.find_page('2009\\02\\09') 60 assert_equal page, wiki.find_page('2009\\02\\09')
61 end 61 end
62 62
63 def test_find_page_without_redirect 63 def test_find_page_without_redirect
64 wiki = Wiki.find(1) 64 wiki = Wiki.find(1)
76 assert_equal 'Another_page', page.title 76 assert_equal 'Another_page', page.title
77 assert_equal true, wiki.page_found_with_redirect? 77 assert_equal true, wiki.page_found_with_redirect?
78 end 78 end
79 79
80 def test_titleize 80 def test_titleize
81 ja_test = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88"
82 ja_test.force_encoding('UTF-8') if ja_test.respond_to?(:force_encoding)
81 assert_equal 'Page_title_with_CAPITALES', Wiki.titleize('page title with CAPITALES') 83 assert_equal 'Page_title_with_CAPITALES', Wiki.titleize('page title with CAPITALES')
82 assert_equal 'テスト', Wiki.titleize('テスト') 84 assert_equal ja_test, Wiki.titleize(ja_test)
83 end 85 end
84 86
85 context "#sidebar" do 87 context "#sidebar" do
86 setup do 88 setup do
87 @wiki = Wiki.find(1) 89 @wiki = Wiki.find(1)