Skip to content
Extraits de code Groupes Projets
Valider e4f8f558 rédigé par maxwell's avatar maxwell
Parcourir les fichiers

aspects now have a max length of 20 characters

parent 4300b20c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -16,6 +16,7 @@ class Aspect
belongs_to :user, :class_name => 'User'
validates_presence_of :name
validates_length_of :name, :maximum => 20
validates_uniqueness_of :name, :scope => :user_id
attr_accessible :name
......
......@@ -905,6 +905,9 @@ h1.big_text
:padding 4px 10px
:color #CCC
:max-width 120px
:overflow hidden
:text-overflow ellipsis
:background
:color #222
......
......@@ -29,6 +29,11 @@ describe Aspect do
}.should_not change(Aspect, :count)
end
it 'should have a limit of 20 characters' do
aspect = Aspect.new(:name => "this name is really too too too too too long")
aspect.valid?.should == false
end
it 'should not be creatable with people' do
aspect = user.aspects.create(:name => 'losers', :people => [friend, friend_2])
aspect.people.size.should == 0
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter