diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-02-11 19:30:53 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-02-11 19:30:53 +0000 |
commit | 541d830d2a968f36d73add2b1e3693eab09136ed (patch) | |
tree | 3b91113bc027ad4303250ac7d19e3ca759dec1fb /test/unit/project_test.rb | |
parent | d2baf5f2a7b00d58b6642a3e3f4024b97a8b9127 (diff) | |
download | redmine-541d830d2a968f36d73add2b1e3693eab09136ed.tar.gz redmine-541d830d2a968f36d73add2b1e3693eab09136ed.zip |
Fixed: Project copy loses wiki pages hierarchy (#4797).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3412 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r-- | test/unit/project_test.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index 447ae1b04..621c11ee7 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -723,16 +723,24 @@ class ProjectTest < ActiveSupport::TestCase assert_equal "Start page", @project.wiki.start_page end - should "copy wiki pages and content" do - assert @project.copy(@source_project) - + should "copy wiki pages and content with hierarchy" do + assert_difference 'WikiPage.count', @source_project.wiki.pages.size do + assert @project.copy(@source_project) + end + assert @project.wiki - assert_equal 1, @project.wiki.pages.length + assert_equal @source_project.wiki.pages.size, @project.wiki.pages.size @project.wiki.pages.each do |wiki_page| assert wiki_page.content assert !@source_project.wiki.pages.include?(wiki_page) end + + parent = @project.wiki.find_page('Parent_page') + child1 = @project.wiki.find_page('Child_page_1') + child2 = @project.wiki.find_page('Child_page_2') + assert_equal parent, child1.parent + assert_equal parent, child2.parent end should "copy issue categories" do |