summaryrefslogtreecommitdiffstats
path: root/test/functional/wiki_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-23 13:36:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-23 13:36:01 +0000
commite0a034164f3409336f686cfa381da8a5db15c40e (patch)
treee4bd9590116c03026375a3ae5c618e01cd7bddc3 /test/functional/wiki_controller_test.rb
parent1ada789a6ccbbbaa55adc3a661ea7cef917d4b71 (diff)
downloadredmine-e0a034164f3409336f686cfa381da8a5db15c40e.tar.gz
redmine-e0a034164f3409336f686cfa381da8a5db15c40e.zip
Move wiki page to other project (#5450).
git-svn-id: http://svn.redmine.org/redmine/trunk@13643 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/wiki_controller_test.rb')
-rw-r--r--test/functional/wiki_controller_test.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index d16a1559c..ebebf343d 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -660,6 +660,39 @@ class WikiControllerTest < ActionController::TestCase
assert_nil WikiPage.find_by_title('Child_1').parent
end
+ def test_get_rename_should_show_target_projects_list
+ @request.session[:user_id] = 2
+ project = Project.find(5)
+ project.enable_module! :wiki
+
+ get :rename, :project_id => 1, :id => 'Another_page'
+ assert_response :success
+ assert_template 'rename'
+
+ assert_select 'select[name=?]', 'wiki_page[wiki_id]' do
+ assert_select 'option', 2
+ assert_select 'option[value=?][selected=selected]', '1', :text => /eCookbook/
+ assert_select 'option[value=?]', project.wiki.id.to_s, :text => /#{project.name}/
+ end
+ end
+
+ def test_rename_with_move
+ @request.session[:user_id] = 2
+ project = Project.find(5)
+ project.enable_module! :wiki
+
+ post :rename, :project_id => 1, :id => 'Another_page',
+ :wiki_page => {
+ :wiki_id => project.wiki.id.to_s,
+ :title => 'Another renamed page',
+ :redirect_existing_links => 1
+ }
+ assert_redirected_to '/projects/private-child/wiki/Another_renamed_page'
+
+ page = WikiPage.find(2)
+ assert_equal project.wiki.id, page.wiki_id
+ end
+
def test_destroy_a_page_without_children_should_not_ask_confirmation
@request.session[:user_id] = 2
delete :destroy, :project_id => 1, :id => 'Child_2'