roles_spec.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. require 'system/examples/pagination_examples'
  4. RSpec.describe 'Manage > Role', type: :system do
  5. context 'ajax pagination' do
  6. include_examples 'pagination', model: :role, klass: Role, path: 'manage/roles'
  7. end
  8. # https://github.com/zammad/zammad/issues/4100
  9. context 'creating a new role' do
  10. before do
  11. visit '#manage/roles'
  12. within(:active_content) do
  13. find('[data-type=new]').click
  14. end
  15. end
  16. it 'handles permission checkboxes correctly' do
  17. in_modal do
  18. scroll_into_view 'table.settings-list'
  19. within 'table.settings-list tbody tr:first-child' do
  20. click 'input[value="full"]', visible: :all
  21. expect(find('input[value="full"]', visible: :all)).to be_checked
  22. click 'input[value="read"]', visible: :all
  23. expect(find('input[value="full"]', visible: :all)).not_to be_checked
  24. expect(find('input[value="read"]', visible: :all)).to be_checked
  25. click 'input[value="full"]', visible: :all
  26. expect(find('input[value="full"]', visible: :all)).to be_checked
  27. expect(find('input[value="read"]', visible: :all)).not_to be_checked
  28. end
  29. end
  30. end
  31. end
  32. end