From 16dcdb6e0ef5ff88eff6372156b4ad9146573c82 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Fri, 28 Jan 2005 02:57:25 +0000 Subject: [PATCH] A friendly confirmation when a new wiki is set up --- app/controllers/admin_controller.rb | 7 ++++++- test/functional/admin_controller_test.rb | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1889acb2..57736c3b 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -15,7 +15,12 @@ class AdminController < ApplicationController elsif @params['web_name'] # form submitted -> create a wiki @wiki.setup(@params['password'], @params['web_name'], @params['web_address']) - redirect_show('HomePage', @params['web_address']) + flash[:info] = <<-EOL + Your new wiki '#{@params['web_name']}' is created!
+ Please edit its home page and press Submit when finished. + EOL + redirect_to :web => @params['web_address'], :controller => 'wiki', :action => 'new', + :id => 'HomePage' else # no form submitted -> go to template end diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index ae424716..22d52211 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -31,7 +31,8 @@ class AdminControllerTest < Test::Unit::TestCase process('create_system', 'password' => 'a_password', 'web_name' => 'My Wiki', 'web_address' => 'my_wiki') - assert_redirected_to :web => 'my_wiki', :action => 'show', :id => 'HomePage' + assert_redirected_to :web => 'my_wiki', :controller => 'wiki', :action => 'new', + :id => 'HomePage' assert @controller.wiki.setup? assert_equal 'a_password', @controller.wiki.system[:password] assert_equal 1, @controller.wiki.webs.size