mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
18 lines
541 B
Ruby
18 lines
541 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe OwnTracks::ExportParser do
|
|
describe '#call' do
|
|
subject(:parser) { described_class.new(import).call }
|
|
|
|
let(:file_path) { 'spec/fixtures/files/owntracks/export.json' }
|
|
let(:file) { fixture_file_upload(file_path) }
|
|
let(:user) { create(:user) }
|
|
let(:import) { create(:import, user: user, file: file, name: File.basename(file.path)) }
|
|
|
|
context 'when file exists' do
|
|
it 'creates points' do
|
|
expect { parser }.to change { Point.count }.by(8)
|
|
end
|
|
end
|
|
end
|
|
end
|