From 8b21b8286f99aa284e4bf5a27eb6a68a55df7cd0 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sat, 5 Feb 2005 13:19:20 +0000 Subject: [PATCH] extra tests for edit_web --- test/functional/admin_controller_test.rb | 26 +++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index d9dee27c..a829ca5b 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -105,14 +105,13 @@ class AdminControllerTest < Test::Unit::TestCase end - def test_edit_web + def test_edit_web_no_form process 'edit_web', 'web' => 'wiki1' # this action simply renders a form assert_success end - - def test_edit_web + def test_edit_web_form_submitted @wiki.system[:password] = 'pswd' process('edit_web', 'system_password' => 'pswd', @@ -154,5 +153,26 @@ class AdminControllerTest < Test::Unit::TestCase assert !@web.allow_uploads end + def test_edit_web_wrong_password + process('edit_web', 'system_password' => 'wrong', + 'web' => 'wiki1', 'address' => 'renamed_wiki1', 'name' => 'Renamed Wiki1', + 'markup' => 'markdown', 'color' => 'blue', 'additional_style' => 'whatever', + 'password' => 'new_password') + + #returns to the same form + assert_success + assert_flash_has :error + end + + def test_edit_web_empty_password + process('edit_web', 'system_password' => '', + 'web' => 'wiki1', 'address' => 'renamed_wiki1', 'name' => 'Renamed Wiki1', + 'markup' => 'markdown', 'color' => 'blue', 'additional_style' => 'whatever', + 'password' => 'new_password') + + #returns to the same form + assert_success + assert_flash_has :error + end end