Permalink
Browse files

aspects now have a max length of 20 characters

  • Loading branch information...
1 parent 4300b20 commit e4f8f558a07cfbe27d352f024149b8e75e571fbd @maxwell maxwell committed Nov 6, 2010
Showing with 9 additions and 0 deletions.
  1. +1 −0 app/models/aspect.rb
  2. +3 −0 public/stylesheets/sass/application.sass
  3. +5 −0 spec/models/aspect_spec.rb
View
@@ -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 @@
}.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 comments on commit e4f8f55

Please sign in to comment.