Commit 3bb862fbd2726388400021e3d7067b236df3ac9b

Authored by Joenio Costa
Committed by Antonio Terceiro
1 parent 8791558a

ActionItem1171: allow create profile starting with number

Showing 2 changed files with 5 additions and 2 deletions   Show diff stats
lib/noosfero.rb
... ... @@ -18,7 +18,7 @@ module Noosfero
18 18 end
19 19  
20 20 def self.identifier_format
21   - '[a-z][a-z0-9~.]*([_-][a-z0-9~.]+)*'
  21 + '[a-z0-9][a-z0-9~.]*([_-][a-z0-9~.]+)*'
22 22 end
23 23  
24 24 private
... ...
test/unit/noosfero_test.rb
... ... @@ -26,7 +26,6 @@ class NoosferoTest < Test::Unit::TestCase
26 26 should 'identifier format' do
27 27 assert_match /^#{Noosfero.identifier_format}$/, 'bli-bla'
28 28 assert_no_match /^#{Noosfero.identifier_format}$/, 'UPPER'
29   - assert_no_match /^#{Noosfero.identifier_format}$/, '129812startingwithnumber'
30 29 assert_match /^#{Noosfero.identifier_format}$/, 'with~tilde'
31 30 assert_match /^#{Noosfero.identifier_format}$/, 'with.dot'
32 31 end
... ... @@ -46,4 +45,8 @@ class NoosferoTest < Test::Unit::TestCase
46 45 assert_equal({:port => 9999}, Noosfero.url_options)
47 46 end
48 47  
  48 + should 'allow identifier starting with number' do
  49 + assert_match /^#{Noosfero.identifier_format}$/, '129812startingwithnumber'
  50 + end
  51 +
49 52 end
... ...