Validate Web address

When changing the address of an existing Web
(or creating a new one), check that the new name is valid.
(Reported by Richard Marquez.)
This commit is contained in:
Jacques Distler 2011-04-24 16:07:43 -05:00
parent 844ce0ed40
commit c010e6b7a4
2 changed files with 17 additions and 2 deletions

View file

@ -56,6 +56,16 @@ class WebTest < ActiveSupport::TestCase
assert_raises(Instiki::ValidationError) {
Web.create(:name => 'Wiki2', :address => "wiki\234", :password => '123')
}
assert_raises(Instiki::ValidationError) {
Web.create(:name => 'Wiki2', :address => "web_list", :password => '123')
}
assert_raises(Instiki::ValidationError) {
Web.create(:name => 'Wiki2', :address => "", :password => '123')
}
assert_raises(Instiki::ValidationError) {
Web.create!(:name => 'Wiki2', :address => "", :password => '123')
Web.create(:name => 'Wiki2', :address => "", :password => '123')
}
end
def test_new_page_linked_from_mother_page