Ensure that the service does not create duplicate visits

This commit is contained in:
Eugene Burmakin 2024-07-27 13:57:01 +02:00
parent 403366c321
commit 3d63b29651

View file

@ -96,6 +96,14 @@ RSpec.describe Areas::Visits::Create do
expect(work_visit.points).to match_array([work_point1, work_point2, work_point3])
end
end
context 'running twice' do
it 'does not create duplicate visits' do
create_visits
expect { create_visits }.not_to(change { Visit.count })
end
end
end
end
end