From 58792737394c59ecac08db2cea0eeebb836f160a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 11 Apr 2010 12:56:18 +0000 Subject: Makes the wiki sidebar editable (#5208). The content of the wiki page named 'Sidebar' is rendered in the sidebar if it exists. Permission to edit protected pages is required to create this page. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3632 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/wiki_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/unit/wiki_test.rb') diff --git a/test/unit/wiki_test.rb b/test/unit/wiki_test.rb index 6595e6dce..9303ce784 100644 --- a/test/unit/wiki_test.rb +++ b/test/unit/wiki_test.rb @@ -43,4 +43,23 @@ class WikiTest < ActiveSupport::TestCase assert_equal 'Page_title_with_CAPITALES', Wiki.titleize('page title with CAPITALES') assert_equal 'テスト', Wiki.titleize('テスト') end + + context "#sidebar" do + setup do + @wiki = Wiki.find(1) + end + + should "return nil if undefined" do + assert_nil @wiki.sidebar + end + + should "return a WikiPage if defined" do + page = @wiki.pages.new(:title => 'Sidebar') + page.content = WikiContent.new(:text => 'Side bar content for test_show_with_sidebar') + page.save! + + assert_kind_of WikiPage, @wiki.sidebar + assert_equal 'Sidebar', @wiki.sidebar.title + end + end end -- cgit v1.2.3