diff --git a/app/models/user.rb b/app/models/user.rb index 516a6cc71..48e2a05f2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -178,6 +178,8 @@ class User def update_post(post, post_hash = {}) if self.owns? post post.update_attributes(post_hash) + aspects = aspects_with_post(post.id) + self.push_to_aspects(post, aspects) end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 55c5575fb..6c5a2d0bc 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -226,6 +226,15 @@ describe User do end end + describe '#update_post' do + + it 'sends a notification to aspects' do + user.should_receive(:push_to_aspects).twice + album = user.post(:album, :name => "cat", :to => aspect.id) + user.update_post(album, :name => 'bat') + end + end + describe 'account removal' do it 'should unfriend everyone' do user.should_receive(:unfriend_everyone)