Skip to content

Commit bb8eb3a

Browse files
committed
Fix test
1 parent 0044a5b commit bb8eb3a

4 files changed

Lines changed: 17 additions & 15 deletions

File tree

spec/models/account/avatar_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
describe 'convertable avatars', :attachment_processing do
3030
describe 'with AVIF' do
3131
it 'creates a jpeg static style' do
32-
account = Fabricate(fabricator, avatar: attachment_fixture('avatar.avif'))
32+
account = Fabricate(:account, avatar: attachment_fixture('avatar.avif'))
3333
expect(account.avatar_original_url.end_with?('.jpeg')).to be true
3434
end
3535
end

spec/models/account/search_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
)
204204
match.follow!(account)
205205

206-
results = described_class.advanced_search_for('A?l\i:c e', account, limit: 10, follower: true)
206+
results = Account.advanced_search_for('A?l\i:c e', account, limit: 10, follower: true)
207207
expect(results).to eq [match]
208208
end
209209

@@ -215,7 +215,7 @@
215215
domain: 'example.com'
216216
)
217217

218-
results = described_class.advanced_search_for('A?l\i:c e', account, limit: 10, follower: true)
218+
results = Account.advanced_search_for('A?l\i:c e', account, limit: 10, follower: true)
219219
expect(results).to eq []
220220
end
221221
end

spec/workers/activitypub/distribution_worker_spec.rb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
end
3333

3434
it 'delivers to followers' do
35-
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com', anything]]) do
36-
subject.perform(status.id)
37-
end
35+
subject.perform(status.id)
36+
37+
expect(ActivityPub::DeliveryWorker)
38+
.to have_enqueued_sidekiq_job(match_json_values(type: 'Create'), status.account.id, 'http://example.com', anything)
3839
end
3940
end
4041

@@ -59,9 +60,10 @@
5960
end
6061

6162
it 'delivers to followers' do
62-
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com/follower/inbox', anything]]) do
63-
subject.perform(status.id)
64-
end
63+
subject.perform(status.id)
64+
65+
expect(ActivityPub::DeliveryWorker)
66+
.to have_enqueued_sidekiq_job(match_json_values(type: 'Create'), status.account.id, 'http://example.com/follower/inbox', anything)
6567
end
6668
end
6769

@@ -91,9 +93,10 @@
9193
end
9294

9395
it 'delivers to followers' do
94-
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com/no_follower/inbox', anything]]) do
95-
subject.perform(status.id)
96-
end
96+
subject.perform(status.id)
97+
98+
expect(ActivityPub::DeliveryWorker)
99+
.to have_enqueued_sidekiq_job(match_json_values(type: 'Create'), status.account.id, 'http://example.com/no_follower/inbox', anything)
97100
end
98101
end
99102

spec/workers/activitypub/status_update_distribution_worker_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@
6161
end
6262

6363
it 'delivers to followers' do
64-
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com', anything]]) do
65-
subject.perform(status.id)
66-
end
64+
expect { subject.perform(status.id) }
65+
.to enqueue_sidekiq_job(ActivityPub::DeliveryWorker).with(match_json_values(type: 'Update'), status.account_id, 'http://example.com', anything)
6766
end
6867
end
6968

0 commit comments

Comments
 (0)