diff --git a/test/unit/mpog_person_test.rb b/test/unit/mpog_person_test.rb new file mode 100644 index 0000000..7179827 --- /dev/null +++ b/test/unit/mpog_person_test.rb @@ -0,0 +1,21 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class MpogSoftwarePluginPersonTest < ActiveSupport::TestCase + should 'save person with a valid full name' do + p = Person::new :name=>"S1mpl3 N4m3", :identifier=>"simple-name" + p.user = fast_create(:user) + + assert_equal true, p.save + end + + should 'not save person whose name has not capital letter' do + p = Person::new :name=>"simple name" + assert !p.save, _("Name Should begin with a capital letter and no special characters") + end + + should 'not save person whose name has special characters' do + p = Person::new :name=>"Simple N@me" + + assert !p.save , _("Name Should begin with a capital letter and no special characters") + end +end \ No newline at end of file -- libgit2 0.21.2