Fix flakys specs
This commit is contained in:
@@ -6,6 +6,10 @@ describe RemoteTranslationsCaller do
|
||||
RemoteTranslation.skip_callback(:create, :after, :enqueue_remote_translation)
|
||||
end
|
||||
|
||||
after do
|
||||
RemoteTranslation.set_callback(:create, :after, :enqueue_remote_translation)
|
||||
end
|
||||
|
||||
describe "#call" do
|
||||
|
||||
context "Debates" do
|
||||
|
||||
@@ -30,14 +30,18 @@ describe RemoteTranslation do
|
||||
|
||||
describe "#enqueue_remote_translation" do
|
||||
|
||||
it "after create enqueue Delayed Job" do
|
||||
before do
|
||||
Delayed::Worker.delay_jobs = true
|
||||
end
|
||||
|
||||
expect { remote_translation.save }.to change { Delayed::Job.count }.by(1)
|
||||
|
||||
after do
|
||||
Delayed::Worker.delay_jobs = false
|
||||
end
|
||||
|
||||
it "after create enqueue Delayed Job" do
|
||||
expect { remote_translation.save }.to change { Delayed::Job.count }.by(1)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user