Skip to content

Commit 5934003

Browse files
committed
fixing tests
1 parent a2155e3 commit 5934003

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

app/jobs/workers/application_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class ApplicationJob < ActiveJob::Base
66
retry_on ActiveRecord::Deadlocked
77

88
# Most jobs are safe to ignore if the underlying records are no longer available
9-
discard_on ActiveJob::DeserializationError
9+
discard_on ActiveJob::DeserializationError, ActiveRecord::RecordNotUnique
1010

1111
sidekiq_options retry: 5
1212
end

app/models/user_services/connecting.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def disconnect(contact)
4747
end
4848

4949
def disconnected_by(person)
50-
contact_for(person).try {|contact|
50+
user.contact_for(person).try {|contact|
5151
disconnect_contact(contact, direction: :sharing, destroy: !contact.receiving)
5252
}
5353
end

app/models/user_services/querying.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def block_for(person)
4545
def aspects_with_shareable(base_class_name_or_class, shareable_id)
4646
base_class_name = base_class_name_or_class
4747
base_class_name = base_class_name_or_class.base_class.to_s if base_class_name_or_class.is_a?(Class)
48-
aspects.joins(:aspect_visibilities).where(aspect_visibilities: {shareable_id: shareable_id,
49-
shareable_type: base_class_name})
48+
user.aspects.joins(:aspect_visibilities).where(aspect_visibilities: {shareable_id: shareable_id,
49+
shareable_type: base_class_name})
5050
end
5151

5252
def contact_for_person_id(person_id)

app/models/user_services/social_actions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def like_comment!(target, opts={})
3535
def reshare!(target, opts={})
3636
raise I18n.t("reshares.create.error") if target.author.guid == user.guid
3737

38-
build_post(:reshare, root_guid: target.guid).tap do |reshare|
38+
user.build_post(:reshare, root_guid: target.guid).tap do |reshare|
3939
reshare.text = opts[:text]
4040
reshare.save!
4141
update_or_create_participation!(target)

lib/diaspora/federation/dispatcher/public.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def deliver_to_remote(people)
1616

1717
return if targets.empty?
1818

19-
Workers::SendPublicJob.perform_later(sender.id, entity.to_s, targets, magic_envelope.to_xml)
19+
::Workers::SendPublicJob.perform_later(sender.id, entity.to_s, targets, magic_envelope.to_xml)
2020
end
2121

2222
def target_urls(people)

spec/models/user_services/querying_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@
335335
end
336336

337337
describe "#posts_from" do
338-
before do
339-
let(:user_charley) { create(:user) }
338+
let(:user_charley) { create(:user) }
340339

340+
before do
341341
@aspect3 = user_charley.aspects.create(name: "bros")
342342

343343
@public_message = user_charley.post(:status_message, text: "hey there", to: "all", public: true)

0 commit comments

Comments
 (0)