remember that aspects are seeded
This commit is contained in:
parent
c1a9a89be7
commit
7643fb4125
2 changed files with 6 additions and 8 deletions
|
|
@ -47,8 +47,7 @@ class User
|
||||||
many :aspects, :class_name => 'Aspect'
|
many :aspects, :class_name => 'Aspect'
|
||||||
|
|
||||||
after_validation_on_create :setup_person
|
after_validation_on_create :setup_person
|
||||||
after_create :seed_groups
|
after_create :seed_aspects
|
||||||
after_save :check_for_tommy
|
|
||||||
|
|
||||||
before_validation :do_bad_things
|
before_validation :do_bad_things
|
||||||
before_save :downcase_username
|
before_save :downcase_username
|
||||||
|
|
@ -338,10 +337,10 @@ class User
|
||||||
self.password_confirmation = self.password
|
self.password_confirmation = self.password
|
||||||
end
|
end
|
||||||
|
|
||||||
def seed_groups
|
def seed_aspects
|
||||||
group(:name => "Acquaintances")
|
aspect(:name => "Acquaintances")
|
||||||
group(:name => "Family")
|
aspect(:name => "Family")
|
||||||
group(:name => "Work")
|
aspect(:name => "Work")
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,7 @@ describe Aspect do
|
||||||
|
|
||||||
it 'belong to a user' do
|
it 'belong to a user' do
|
||||||
@aspect.user.id.should == @user.id
|
@aspect.user.id.should == @user.id
|
||||||
@user.aspects.size.should == 1
|
@user.aspects.size.should == 4
|
||||||
@user.aspects.first.id.should == @aspect.id
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should have people' do
|
it 'should have people' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue