Mercurial > hg > soundsoftware-site
comparison test/unit/.svn/text-base/wiki_test.rb.svn-base @ 119:8661b858af72
* Update to Redmine trunk rev 4705
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 14:12:06 +0000 |
parents | 513646585e45 |
children | cd2282d2aa55 cbce1fd3b1b7 |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 119:8661b858af72 |
---|---|
15 # | 15 # |
16 # You should have received a copy of the GNU General Public License | 16 # You should have received a copy of the GNU General Public License |
17 # along with this program; if not, write to the Free Software | 17 # along with this program; if not, write to the Free Software |
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
19 | 19 |
20 require File.dirname(__FILE__) + '/../test_helper' | 20 require File.expand_path('../../test_helper', __FILE__) |
21 | 21 |
22 class WikiTest < ActiveSupport::TestCase | 22 class WikiTest < ActiveSupport::TestCase |
23 fixtures :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions | 23 fixtures :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions |
24 | 24 |
25 def test_create | 25 def test_create |
35 @wiki = Wiki.find(1) | 35 @wiki = Wiki.find(1) |
36 @wiki.start_page = "Another start page" | 36 @wiki.start_page = "Another start page" |
37 assert @wiki.save | 37 assert @wiki.save |
38 @wiki.reload | 38 @wiki.reload |
39 assert_equal "Another start page", @wiki.start_page | 39 assert_equal "Another start page", @wiki.start_page |
40 end | |
41 | |
42 def test_find_page | |
43 wiki = Wiki.find(1) | |
44 page = WikiPage.find(2) | |
45 | |
46 assert_equal page, wiki.find_page('Another_page') | |
47 assert_equal page, wiki.find_page('Another page') | |
48 assert_equal page, wiki.find_page('ANOTHER page') | |
49 | |
50 page = WikiPage.find(10) | |
51 assert_equal page, wiki.find_page('Этика_менеджмента') | |
40 end | 52 end |
41 | 53 |
42 def test_titleize | 54 def test_titleize |
43 assert_equal 'Page_title_with_CAPITALES', Wiki.titleize('page title with CAPITALES') | 55 assert_equal 'Page_title_with_CAPITALES', Wiki.titleize('page title with CAPITALES') |
44 assert_equal 'テスト', Wiki.titleize('テスト') | 56 assert_equal 'テスト', Wiki.titleize('テスト') |