calendars_spec.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. require 'rails_helper'
  2. RSpec.describe 'Manage > Calendars', type: :system do
  3. context 'Date' do
  4. let(:calendar_title) { "test calendar #{rand(999_999_999)}" }
  5. it 'show festivity dates correctly far away from UTC', time_zone: 'America/Sao_Paulo' do
  6. visit '/#manage/calendars'
  7. click '.js-new'
  8. modal_ready
  9. within '.modal-dialog' do
  10. fill_in 'name', with: calendar_title
  11. click '.dropdown-toggle'
  12. click '.dropdown-menu [data-value="America/Sao_Paulo"]'
  13. find('.ical_feed select').select 'Brazil'
  14. click '.js-submit'
  15. end
  16. modal_disappear
  17. within :active_content do
  18. within '.action', text: calendar_title do
  19. find('.js-edit').click
  20. end
  21. end
  22. wait(5).until_constant { find('.modal-dialog').style('height') }
  23. within '.modal-dialog' do
  24. row = first('.holiday_selector tr') do |elem|
  25. elem.find('input.js-summary').value.starts_with?('Christmas Eve')
  26. rescue
  27. false
  28. end
  29. expect(row).to have_text('24').and have_text('12')
  30. end
  31. end
  32. end
  33. end