dawarich/spec/requests/api/v1/overland/batches_spec.rb
2024-04-06 19:09:38 +02:00

22 lines
611 B
Ruby

require 'rails_helper'
RSpec.describe "Api::V1::Overland::Batches", type: :request do
describe "POST /index" do
let(:file_path) { 'spec/fixtures/overland/geodata.json' }
let(:file) { File.open(file_path) }
let(:json) { JSON.parse(file.read) }
let(:params) { json }
it 'returns http success' do
post '/api/v1/overland/batches', params: params
expect(response).to have_http_status(:created)
end
it 'enqueues a job' do
expect do
post '/api/v1/overland/batches', params: params
end.to have_enqueued_job(Overland::BatchCreatingJob)
end
end
end