From 6064b2e022953c8bbc1bd4bf10ab7a3327eeb8ec Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 8 Oct 2010 14:37:22 -0700 Subject: [PATCH] Add a spec, move another to posting --- spec/models/user/posting_spec.rb | 5 +++++ spec/models/user/receive_spec.rb | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 563e1473b..7b6913c0c 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -44,6 +44,11 @@ describe User do aspect.reload aspect.posts.should include album end + it "should add the post to that user's visible posts" do + status_message = user.post :status_message, :message => "hi", :to => aspect.id + user.reload + user.raw_visible_posts.include?(status_message).should be true + end end describe '#update_post' do diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index c9ec4e207..03c347408 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -50,10 +50,15 @@ describe User do end - it "should add the post to that user's posts when a user posts it" do + it "should add a received post to the aspect and visible_posts array" do status_message = @user.post :status_message, :message => "hi", :to => @aspect.id @user.reload - @user.raw_visible_posts.include?(status_message).should be true + salmon = @user.salmon(status_message).xml_for @user2.person + @user2.receive_salmon salmon + @user2.reload + @user2.raw_visible_posts.include?(status_message).should be true + @aspect2.reload + @aspect2.posts.include?(status_message).should be_true end it 'should be removed on unfriending' do