extra tests for edit_web

This commit is contained in:
Alexey Verkhovsky 2005-02-05 13:19:20 +00:00
parent 09cfb5635c
commit 8b21b8286f

View file

@ -105,14 +105,13 @@ class AdminControllerTest < Test::Unit::TestCase
end end
def test_edit_web def test_edit_web_no_form
process 'edit_web', 'web' => 'wiki1' process 'edit_web', 'web' => 'wiki1'
# this action simply renders a form # this action simply renders a form
assert_success assert_success
end end
def test_edit_web_form_submitted
def test_edit_web
@wiki.system[:password] = 'pswd' @wiki.system[:password] = 'pswd'
process('edit_web', 'system_password' => 'pswd', process('edit_web', 'system_password' => 'pswd',
@ -154,5 +153,26 @@ class AdminControllerTest < Test::Unit::TestCase
assert !@web.allow_uploads assert !@web.allow_uploads
end 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 end