extra tests for edit_web
This commit is contained in:
parent
09cfb5635c
commit
8b21b8286f
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue