summaryrefslogtreecommitdiffstats
path: root/test/unit/wiki_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-04-11 12:56:18 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-04-11 12:56:18 +0000
commit58792737394c59ecac08db2cea0eeebb836f160a (patch)
tree20356d7c4801a53e47df1273d7c011441beee62c /test/unit/wiki_test.rb
parent3979224693c796b162e3bf815fa33265869f1b18 (diff)
downloadredmine-58792737394c59ecac08db2cea0eeebb836f160a.tar.gz
redmine-58792737394c59ecac08db2cea0eeebb836f160a.zip
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
Diffstat (limited to 'test/unit/wiki_test.rb')
-rw-r--r--test/unit/wiki_test.rb19
1 files changed, 19 insertions, 0 deletions
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