dawarich/spec/jobs/points/create_job_spec.rb
2025-01-20 20:07:46 +01:00

18 lines
490 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Points::CreateJob, type: :job do
describe '#perform' do
subject(:perform) { described_class.new.perform(json, user.id) }
let(:file_path) { 'spec/fixtures/files/points/geojson_example.json' }
let(:file) { File.open(file_path) }
let(:json) { JSON.parse(file.read) }
let(:user) { create(:user) }
it 'creates a point' do
expect { perform }.to change { Point.count }.by(6)
end
end
end