parse_spec.rb 860 B

1234567891011121314151617181920212223242526
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Service::Calendar::IcsFile::Parse do
  4. subject(:service) { described_class.new(current_user: user) }
  5. let(:user) { create(:user) }
  6. let(:calendar_file) { create(:store, :ics) }
  7. it 'parses the calendar file' do
  8. expect(service.execute(file: calendar_file)).to eq(
  9. events: [{
  10. title: 'Test Summary',
  11. location: 'https://us.zoom.us/j/example?pwd=test',
  12. start_date: '2021-07-27T10:30:00.000+02:00',
  13. end_date: '2021-07-27T12:00:00.000+02:00',
  14. attendees: ['M.bob@example.com', 'J.doe@example.com'],
  15. organizer: 'f.sample@example.com',
  16. description: 'Test description'
  17. }],
  18. filename: 'basic.ics',
  19. type: 'text/calendar'
  20. )
  21. end
  22. end