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
|
end
|
||||||
|
|
||||||
def deliver_profile_update
|
def deliver_profile_update
|
||||||
Postzord::Dispatcher.build(self, profile).post
|
Diaspora::Federation::Dispatcher.defer_dispatch(self, profile)
|
||||||
end
|
end
|
||||||
|
|
||||||
def basic_profile_present?
|
def basic_profile_present?
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,9 @@ describe User::Connecting, type: :model do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "posts profile" do
|
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)
|
alice.share_with(eve.person, alice.aspects.first)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -498,16 +498,14 @@ describe User, :type => :model do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'dispatches the profile when tags are set' do
|
it "dispatches the profile when tags are set" do
|
||||||
@params = {:tag_string => '#what #hey'}
|
@params = {tag_string: '#what #hey'}
|
||||||
mailman = Postzord::Dispatcher.build(alice, Profile.new(person: alice.person))
|
expect(Diaspora::Federation::Dispatcher).to receive(:defer_dispatch).with(alice, alice.profile)
|
||||||
expect(Postzord::Dispatcher).to receive(:build).and_return(mailman)
|
|
||||||
expect(alice.update_profile(@params)).to be true
|
expect(alice.update_profile(@params)).to be true
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sends a profile to their contacts' do
|
it "sends a profile to their contacts" do
|
||||||
mailman = Postzord::Dispatcher.build(alice, Profile.new(person: alice.person))
|
expect(Diaspora::Federation::Dispatcher).to receive(:defer_dispatch).with(alice, alice.profile)
|
||||||
expect(Postzord::Dispatcher).to receive(:build).and_return(mailman)
|
|
||||||
expect(alice.update_profile(@params)).to be true
|
expect(alice.update_profile(@params)).to be true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue