Switch dispatch_post and add_to_streams
This commit is contained in:
parent
3fc2dfb31a
commit
6a0a945986
2 changed files with 8 additions and 1 deletions
|
|
@ -22,8 +22,8 @@ class StatusMessagesController < ApplicationController
|
|||
aspects = current_user.aspects_from_ids(params[:aspect_ids])
|
||||
|
||||
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.dispatch_post(@status_message, :url => post_url(@status_message))
|
||||
if !photos.empty?
|
||||
@status_message.photos += photos
|
||||
for photo in photos
|
||||
|
|
|
|||
|
|
@ -78,6 +78,13 @@ describe StatusMessagesController do
|
|||
old_status_message.reload.message.should == 'hello'
|
||||
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
|
||||
before do
|
||||
fixture_filename = 'button.png'
|
||||
|
|
|
|||
Loading…
Reference in a new issue