deliver profile update with new dispatcher
This commit is contained in:
parent
caf5d562de
commit
9ce9b4bcd0
3 changed files with 9 additions and 9 deletions
|
|
@ -416,7 +416,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def deliver_profile_update
|
||||
Postzord::Dispatcher.build(self, profile).post
|
||||
Diaspora::Federation::Dispatcher.defer_dispatch(self, profile)
|
||||
end
|
||||
|
||||
def basic_profile_present?
|
||||
|
|
|
|||
|
|
@ -158,7 +158,9 @@ describe User::Connecting, type: :model do
|
|||
end
|
||||
|
||||
it "posts profile" do
|
||||
skip # TODO
|
||||
allow(Diaspora::Federation::Dispatcher).to receive(:defer_dispatch)
|
||||
expect(Diaspora::Federation::Dispatcher).to receive(:defer_dispatch).with(alice, alice.profile)
|
||||
|
||||
alice.share_with(eve.person, alice.aspects.first)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -498,16 +498,14 @@ describe User, :type => :model do
|
|||
}
|
||||
end
|
||||
|
||||
it 'dispatches the profile when tags are set' do
|
||||
@params = {:tag_string => '#what #hey'}
|
||||
mailman = Postzord::Dispatcher.build(alice, Profile.new(person: alice.person))
|
||||
expect(Postzord::Dispatcher).to receive(:build).and_return(mailman)
|
||||
it "dispatches the profile when tags are set" do
|
||||
@params = {tag_string: '#what #hey'}
|
||||
expect(Diaspora::Federation::Dispatcher).to receive(:defer_dispatch).with(alice, alice.profile)
|
||||
expect(alice.update_profile(@params)).to be true
|
||||
end
|
||||
|
||||
it 'sends a profile to their contacts' do
|
||||
mailman = Postzord::Dispatcher.build(alice, Profile.new(person: alice.person))
|
||||
expect(Postzord::Dispatcher).to receive(:build).and_return(mailman)
|
||||
it "sends a profile to their contacts" do
|
||||
expect(Diaspora::Federation::Dispatcher).to receive(:defer_dispatch).with(alice, alice.profile)
|
||||
expect(alice.update_profile(@params)).to be true
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue