mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Fix jobs specs
This commit is contained in:
parent
e169cc7074
commit
a1e83991fa
1 changed files with 6 additions and 6 deletions
|
|
@ -58,7 +58,7 @@ RSpec.describe BulkVisitsSuggestingJob, type: :job do
|
||||||
allow(User).to receive(:active).and_return(active_users_mock)
|
allow(User).to receive(:active).and_return(active_users_mock)
|
||||||
allow(active_users_mock).to receive(:active).and_return(active_users_mock)
|
allow(active_users_mock).to receive(:active).and_return(active_users_mock)
|
||||||
allow(active_users_mock).to receive(:where).with(id: []).and_return(active_users_mock)
|
allow(active_users_mock).to receive(:where).with(id: []).and_return(active_users_mock)
|
||||||
# allow(active_users_mock).to receive(:find_each).and_yield(user_with_points)
|
allow(active_users_mock).to receive(:find_each).and_yield(user_with_points)
|
||||||
|
|
||||||
chunks.each do |chunk|
|
chunks.each do |chunk|
|
||||||
expect(VisitSuggestingJob).to receive(:perform_later).with(
|
expect(VisitSuggestingJob).to receive(:perform_later).with(
|
||||||
|
|
@ -100,11 +100,11 @@ RSpec.describe BulkVisitsSuggestingJob, type: :job do
|
||||||
.and_return(time_chunks_instance)
|
.and_return(time_chunks_instance)
|
||||||
allow(time_chunks_instance).to receive(:call).and_return(custom_chunks)
|
allow(time_chunks_instance).to receive(:call).and_return(custom_chunks)
|
||||||
|
|
||||||
# active_users_mock = double('ActiveRecord::Relation')
|
active_users_mock = double('ActiveRecord::Relation')
|
||||||
# allow(User).to receive(:active).and_return(active_users_mock)
|
allow(User).to receive(:active).and_return(active_users_mock)
|
||||||
# allow(active_users_mock).to receive(:active).and_return(active_users_mock)
|
allow(active_users_mock).to receive(:active).and_return(active_users_mock)
|
||||||
# allow(active_users_mock).to receive(:where).with(id: []).and_return(active_users_mock)
|
allow(active_users_mock).to receive(:where).with(id: []).and_return(active_users_mock)
|
||||||
# allow(active_users_mock).to receive(:find_each).and_yield(user_with_points)
|
allow(active_users_mock).to receive(:find_each).and_yield(user_with_points)
|
||||||
|
|
||||||
expect(VisitSuggestingJob).to receive(:perform_later).with(
|
expect(VisitSuggestingJob).to receive(:perform_later).with(
|
||||||
user_id: user_with_points.id,
|
user_id: user_with_points.id,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue