calendar_spec.rb 981 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Profile > Calendar', type: :system do
  4. before do
  5. visit 'profile/calendar_subscriptions'
  6. end
  7. context 'when api enabled', authenticated_as: :authenticate do
  8. def authenticate
  9. Setting.set('api_password_access', true)
  10. true
  11. end
  12. it 'does not show any warning about the API access' do
  13. expect(page).to have_no_text('REST API access using the username/email address and password is currently disabled. Please contact your administrator.')
  14. end
  15. end
  16. context 'when api disabled', authenticated_as: :authenticate do
  17. def authenticate
  18. Setting.set('api_password_access', false)
  19. true
  20. end
  21. it 'does show warning about the API access' do
  22. expect(page).to have_text('REST API access using the username/email address and password is currently disabled. Please contact your administrator.')
  23. end
  24. end
  25. end