dawarich/spec/jobs/overland/batch_creating_job_spec.rb

16 lines
423 B
Ruby
Raw Normal View History

2024-04-06 13:09:38 -04:00
require 'rails_helper'
RSpec.describe Overland::BatchCreatingJob, type: :job do
describe '#perform' do
subject(:perform) { described_class.new.perform(json) }
let(:file_path) { 'spec/fixtures/files/overland/geodata.json' }
2024-04-06 13:09:38 -04:00
let(:file) { File.open(file_path) }
let(:json) { JSON.parse(file.read) }
it 'creates a location' do
expect { perform }.to change { Point.count }.by(1)
end
end
end