aspects now have a max length of 20 characters
This commit is contained in:
parent
4300b20c34
commit
e4f8f558a0
3 changed files with 9 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ class Aspect
|
||||||
belongs_to :user, :class_name => 'User'
|
belongs_to :user, :class_name => 'User'
|
||||||
|
|
||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
|
validates_length_of :name, :maximum => 20
|
||||||
validates_uniqueness_of :name, :scope => :user_id
|
validates_uniqueness_of :name, :scope => :user_id
|
||||||
attr_accessible :name
|
attr_accessible :name
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -905,6 +905,9 @@ h1.big_text
|
||||||
|
|
||||||
:padding 4px 10px
|
:padding 4px 10px
|
||||||
:color #CCC
|
:color #CCC
|
||||||
|
:max-width 120px
|
||||||
|
:overflow hidden
|
||||||
|
:text-overflow ellipsis
|
||||||
|
|
||||||
:background
|
:background
|
||||||
:color #222
|
:color #222
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,11 @@ describe Aspect do
|
||||||
}.should_not change(Aspect, :count)
|
}.should_not change(Aspect, :count)
|
||||||
end
|
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
|
it 'should not be creatable with people' do
|
||||||
aspect = user.aspects.create(:name => 'losers', :people => [friend, friend_2])
|
aspect = user.aspects.create(:name => 'losers', :people => [friend, friend_2])
|
||||||
aspect.people.size.should == 0
|
aspect.people.size.should == 0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue