mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Update specs for reverse geocoding
This commit is contained in:
parent
974f45a4c9
commit
1229b4121c
3 changed files with 6 additions and 0 deletions
|
|
@ -23,6 +23,8 @@ RSpec.describe Place, type: :model do
|
|||
describe '#async_reverse_geocode' do
|
||||
let(:place) { create(:place) }
|
||||
|
||||
before { allow(DawarichSettings).to receive(:reverse_geocoding_enabled?).and_return(true) }
|
||||
|
||||
it 'updates address' do
|
||||
expect { place.async_reverse_geocode }.to have_enqueued_job(ReverseGeocodingJob).with('Place', place.id)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ RSpec.describe Point, type: :model do
|
|||
describe '#async_reverse_geocode' do
|
||||
let(:point) { build(:point) }
|
||||
|
||||
before { allow(DawarichSettings).to receive(:reverse_geocoding_enabled?).and_return(true) }
|
||||
|
||||
it 'enqueues ReverseGeocodeJob with correct arguments' do
|
||||
point.save
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe Jobs::Create do
|
||||
describe '#call' do
|
||||
before { allow(DawarichSettings).to receive(:reverse_geocoding_enabled?).and_return(true) }
|
||||
|
||||
context 'when job_name is start_reverse_geocoding' do
|
||||
let(:user) { create(:user) }
|
||||
let(:points) { create_list(:point, 4, user:) }
|
||||
|
|
|
|||
Loading…
Reference in a new issue