From 0ecc27a935f123720e9bd9f7cf9c9b0c912b9cbe Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 2 Nov 2010 18:56:00 -0700 Subject: [PATCH] MS IZ posts should now update --- app/models/user.rb | 2 ++ spec/models/user_spec.rb | 9 +++++++++ 2 files changed, 11 insertions(+) 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)