Added validations to edit_web (it could overwrite parameters of an existing Wiki before)
This commit is contained in:
parent
b888799798
commit
4e6d2cbdf6
3 changed files with 23 additions and 1 deletions
|
@ -131,7 +131,7 @@ class WikiControllerTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
else
|
||||
puts 'Warning: tests involving pdflatex are very slow, therefore they are disable by default.'
|
||||
puts 'Warning: tests involving pdflatex are very slow, therefore they are disabled by default.'
|
||||
puts ' Set environment variable INSTIKI_TEST_PDFLATEX or global Ruby variable'
|
||||
puts ' $INSTIKI_TEST_PDFLATEX to enable them.'
|
||||
end
|
||||
|
|
|
@ -69,6 +69,19 @@ class WikiServiceTest < Test::Unit::TestCase
|
|||
assert_equal(@s.storage_path + '/instiki', file_yard.files_path)
|
||||
end
|
||||
|
||||
def test_edit_web_validations
|
||||
another_web = @s.create_web 'Another', 'another'
|
||||
|
||||
# try to rename instiki web to another (which is the name of an already existing one)
|
||||
assert_raises(Instiki::ValidationError) {
|
||||
@s.edit_web('instiki', 'another', @web.name, @web.markup, @web.color, @web.additional_style)
|
||||
}
|
||||
|
||||
assert_raises(Instiki::ValidationError) {
|
||||
@s.edit_web('nonexistant', 'another', @web.name, @web.markup, @web.color, @web.additional_style)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
# Checks that a method call or a block doesn;t change the persisted state of the wiki
|
||||
# Usage:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue