Skip to content
Extraits de code Groupes Projets
Valider c9db65ae rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Merge pull request #5614 from sam09/develop

Fixed Bug #5593.
parents b4ff1f97 a12c0d83
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -32,6 +32,7 @@ class Profile < ActiveRecord::Base
validates :first_name, :length => { :maximum => 32 }
validates :last_name, :length => { :maximum => 32 }
validates :location, :length => { :maximum =>255 }
validates_format_of :first_name, :with => /\A[^;]+\z/, :allow_blank => true
validates_format_of :last_name, :with => /\A[^;]+\z/, :allow_blank => true
......
......@@ -112,6 +112,18 @@ describe Profile, :type => :model do
end
end
describe "of location" do
it "can be 255 characters long" do
profile = FactoryGirl.build(:profile, :location => "a"*255)
expect(profile).to be_valid
end
it "cannot be 256 characters" do
profile = FactoryGirl.build(:profile, :location => "a"*256)
expect(profile).not_to be_valid
end
end
describe '#image_url=' do
before do
@profile = FactoryGirl.build(:profile)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter