mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 03:27:52 +00:00
- We have observed some failures for data import jobs in the cloud due to race conditions with job executions and active storage file uploading. This PR adds delays and retries to accommodate that.
24 lines
552 B
Ruby
24 lines
552 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe DataImport do
|
|
describe 'associations' do
|
|
it { is_expected.to belong_to(:account) }
|
|
end
|
|
|
|
describe 'validations' do
|
|
it 'returns false for invalid data type' do
|
|
expect(build(:data_import, data_type: 'Xyc').valid?).to be false
|
|
end
|
|
end
|
|
|
|
describe 'callbacks' do
|
|
let(:data_import) { build(:data_import) }
|
|
|
|
it 'schedules a job after creation' do
|
|
expect do
|
|
data_import.save
|
|
end.to have_enqueued_job(DataImportJob).with(data_import).on_queue('low')
|
|
end
|
|
end
|
|
end
|