Switch dispatch_post and add_to_streams

This commit is contained in:
Raphael Sofaer 2011-02-12 13:36:38 -08:00
parent 3fc2dfb31a
commit 6a0a945986
2 changed files with 8 additions and 1 deletions

View file

@ -22,8 +22,8 @@ class StatusMessagesController < ApplicationController
aspects = current_user.aspects_from_ids(params[:aspect_ids]) aspects = current_user.aspects_from_ids(params[:aspect_ids])
if @status_message.save if @status_message.save
current_user.dispatch_post(@status_message, :url => post_url(@status_message))
current_user.add_to_streams(@status_message, aspects) current_user.add_to_streams(@status_message, aspects)
current_user.dispatch_post(@status_message, :url => post_url(@status_message))
if !photos.empty? if !photos.empty?
@status_message.photos += photos @status_message.photos += photos
for photo in photos for photo in photos

View file

@ -78,6 +78,13 @@ describe StatusMessagesController do
old_status_message.reload.message.should == 'hello' old_status_message.reload.message.should == 'hello'
end end
it 'calls dispatch post once subscribers is set' do
@user1.should_receive(:dispatch_post){|post, opts|
post.subscribers(@user1).should == [@user2.person]
}
post :create, status_message_hash
end
context 'with photos' do context 'with photos' do
before do before do
fixture_filename = 'button.png' fixture_filename = 'button.png'