|
1 | 1 | require 'spec_helper' |
2 | 2 |
|
3 | 3 | if defined?(Sidekiq) |
4 | | - require 'sidekiq/testing' |
| 4 | + Sidekiq.testing!(:fake) |
5 | 5 |
|
6 | 6 | describe Chewy::Strategy::LazySidekiq do |
7 | 7 | around do |example| |
|
39 | 39 | )) |
40 | 40 | .and_call_original |
41 | 41 | .once |
42 | | - Sidekiq::Testing.inline! do |
| 42 | + Sidekiq.testing!(:inline) do |
43 | 43 | expect { [city, other_city].map(&:save!) } |
44 | 44 | .to update_index(CitiesIndex, strategy: :lazy_sidekiq) |
45 | 45 | .and_reindex(city, other_city).only |
|
60 | 60 | )) |
61 | 61 | .and_call_original |
62 | 62 | .once |
63 | | - Sidekiq::Testing.inline! do |
| 63 | + Sidekiq.testing!(:inline) do |
64 | 64 | expect { [city, other_city].map(&:destroy) }.to update_index(CitiesIndex, strategy: :sidekiq) |
65 | 65 | end |
66 | 66 | end |
|
71 | 71 | expect(other_city).to receive(:run_chewy_callbacks).and_call_original |
72 | 72 |
|
73 | 73 | expect do |
74 | | - Sidekiq::Testing.inline! do |
| 74 | + Sidekiq.testing!(:inline) do |
75 | 75 | Chewy::Strategy::LazySidekiq::IndicesUpdateWorker.new.perform({'City' => [city.id, other_city.id]}) |
76 | 76 | end |
77 | 77 | end.to update_index(CitiesIndex).and_reindex(city, other_city).only |
|
88 | 88 | expect(other_city).to receive(:run_chewy_callbacks).and_call_original |
89 | 89 |
|
90 | 90 | expect do |
91 | | - Sidekiq::Testing.inline! do |
| 91 | + Sidekiq.testing!(:inline) do |
92 | 92 | Chewy::Strategy::LazySidekiq::IndicesUpdateWorker.new.perform({'City' => [city.id, other_city.id]}) |
93 | 93 | end |
94 | 94 | end.to update_index(CitiesIndex).and_reindex(city, other_city).only.no_refresh |
|
97 | 97 | end |
98 | 98 |
|
99 | 99 | context 'integration' do |
100 | | - around { |example| Sidekiq::Testing.inline! { example.run } } |
| 100 | + around { |example| Sidekiq.testing!(:inline) { example.run } } |
101 | 101 |
|
102 | 102 | let(:update_condition) { true } |
103 | 103 |
|
|
0 commit comments