favorite_spec.rb 932 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Mobile > Favorite', app: :mobile, type: :system do
  4. describe 'overview configuration' do
  5. before do
  6. create(:overview, name: 'Test Overview')
  7. visit '/'
  8. end
  9. it 'user can change overview order' do
  10. click_on 'Edit'
  11. expect_current_route('/favorite/ticket-overviews/edit')
  12. expect(page).to have_text("Test Overview\nMy Assigned Tickets")
  13. o1 = find('div[draggable=true]', text: 'Test Overview')
  14. o2 = find('div[draggable=true]', text: 'My Assigned Tickets')
  15. o1.drag_to(o2)
  16. expect(page).to have_text("My Assigned Tickets\nTest Overview")
  17. click_on 'Save'
  18. expect(page).to have_text('Ticket Overview settings are saved.')
  19. expect_current_route('/')
  20. expect(page).to have_text("My Assigned Tickets\n0\nTest Overview")
  21. end
  22. end
  23. end