report_spec.rb 985 B

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Report', type: :system, searchindex: true do
  4. before do
  5. configure_elasticsearch(required: true, rebuild: true)
  6. end
  7. context 'with ticket search result' do
  8. let(:label) { find('.content ul.checkbox-list') }
  9. before do
  10. create(:report_profile, name: report_profile_name, active: active)
  11. visit 'report'
  12. end
  13. context 'with an active report profile' do
  14. let(:report_profile_name) { 'active report profile' }
  15. let(:active) { true }
  16. it 'shows active report profile' do
  17. expect(label).to have_text(report_profile_name)
  18. end
  19. end
  20. context 'with an inactive report profile' do
  21. let(:report_profile_name) { 'inactive report profile' }
  22. let(:active) { false }
  23. it 'does not show inactive report profile' do
  24. expect(label).to have_no_text(report_profile_name)
  25. end
  26. end
  27. end
  28. end