Commit 30f5ba9a1210b3363067309f9374a6ba65e0861e
1 parent
0be3b09c
Exists in
master
and in
5 other branches
correcoes_aderencia: Unit test for person full name validation
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing
1 changed file
with
21 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +require File.dirname(__FILE__) + '/../../../../test/test_helper' | |
| 2 | + | |
| 3 | +class MpogSoftwarePluginPersonTest < ActiveSupport::TestCase | |
| 4 | + should 'save person with a valid full name' do | |
| 5 | + p = Person::new :name=>"S1mpl3 N4m3", :identifier=>"simple-name" | |
| 6 | + p.user = fast_create(:user) | |
| 7 | + | |
| 8 | + assert_equal true, p.save | |
| 9 | + end | |
| 10 | + | |
| 11 | + should 'not save person whose name has not capital letter' do | |
| 12 | + p = Person::new :name=>"simple name" | |
| 13 | + assert !p.save, _("Name Should begin with a capital letter and no special characters") | |
| 14 | + end | |
| 15 | + | |
| 16 | + should 'not save person whose name has special characters' do | |
| 17 | + p = Person::new :name=>"Simple N@me" | |
| 18 | + | |
| 19 | + assert !p.save , _("Name Should begin with a capital letter and no special characters") | |
| 20 | + end | |
| 21 | +end | |
| 0 | 22 | \ No newline at end of file | ... | ... |