From 4c83541c2119861e95a8b5548d1dbf4b2853244c Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Fri, 11 Feb 2022 10:18:56 +0100 Subject: [PATCH] Maintenance: Improve test stability. --- spec/support/capybara/authenticated.rb | 2 ++ spec/system/ticket/zoom_spec.rb | 11 +++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/spec/support/capybara/authenticated.rb b/spec/support/capybara/authenticated.rb index 7388f157a..be0fc1666 100644 --- a/spec/support/capybara/authenticated.rb +++ b/spec/support/capybara/authenticated.rb @@ -34,6 +34,8 @@ RSpec.configure do |config| wait.until_exists do current_login end + + await_empty_ajax_queue end end end diff --git a/spec/system/ticket/zoom_spec.rb b/spec/system/ticket/zoom_spec.rb index 38688ddd4..1e7945be3 100644 --- a/spec/system/ticket/zoom_spec.rb +++ b/spec/system/ticket/zoom_spec.rb @@ -959,14 +959,9 @@ RSpec.describe 'Ticket zoom', type: :system do end # https://github.com/zammad/zammad/issues/3335 - context 'ticket state sort order maintained when locale is de-de', authenticated_as: :authenticate do - def authenticate - user.preferences[:locale] = 'de-de' - user - end - + context 'ticket state sort order maintained when locale is de-de', authenticated_as: :user do context 'when existing ticket is open' do - let(:user) { create(:customer) } + let(:user) { create(:customer, preferences: { locale: 'de-de' }) } let(:ticket) { create(:ticket, customer: user) } it 'shows ticket state dropdown options in sorted translated alphabetically order' do @@ -979,7 +974,7 @@ RSpec.describe 'Ticket zoom', type: :system do end context 'when a new ticket is created' do - let(:user) { create(:agent, groups: [permitted_group]) } + let(:user) { create(:agent, preferences: { locale: 'de-de' }, groups: [permitted_group]) } let(:permitted_group) { create(:group) } it 'shows ticket state dropdown options in sorted order' do