dawarich/spec/requests/api/v1/overland/batches_spec.rb
2024-05-18 13:58:02 +02:00

24 lines
648 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Api::V1::Overland::Batches', type: :request do
describe 'POST /index' do
let(:file_path) { 'spec/fixtures/files/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