A friendly confirmation when a new wiki is set up

This commit is contained in:
Alexey Verkhovsky 2005-01-28 02:57:25 +00:00
parent 22e7104ea1
commit 16dcdb6e0e
2 changed files with 8 additions and 2 deletions

View file

@ -15,7 +15,12 @@ class AdminController < ApplicationController
elsif @params['web_name'] elsif @params['web_name']
# form submitted -> create a wiki # form submitted -> create a wiki
@wiki.setup(@params['password'], @params['web_name'], @params['web_address']) @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!<br/>
Please edit its home page and press Submit when finished.
EOL
redirect_to :web => @params['web_address'], :controller => 'wiki', :action => 'new',
:id => 'HomePage'
else else
# no form submitted -> go to template # no form submitted -> go to template
end end

View file

@ -31,7 +31,8 @@ class AdminControllerTest < Test::Unit::TestCase
process('create_system', 'password' => 'a_password', 'web_name' => 'My Wiki', process('create_system', 'password' => 'a_password', 'web_name' => 'My Wiki',
'web_address' => '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 @controller.wiki.setup?
assert_equal 'a_password', @controller.wiki.system[:password] assert_equal 'a_password', @controller.wiki.system[:password]
assert_equal 1, @controller.wiki.webs.size assert_equal 1, @controller.wiki.webs.size