From 170bfc6e594c9f859f385796b6ccc642762275f6 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Fri, 11 Feb 2022 09:28:47 +0100 Subject: [PATCH] Maintenance: Stabilize ticket history test. --- spec/system/ticket/history_spec.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/system/ticket/history_spec.rb b/spec/system/ticket/history_spec.rb index 05c82a690..b50fec009 100644 --- a/spec/system/ticket/history_spec.rb +++ b/spec/system/ticket/history_spec.rb @@ -2,10 +2,10 @@ require 'rails_helper' -RSpec.describe 'Ticket history', type: :system, time_zone: 'Europe/London' do - let(:group) { Group.find_by(name: 'Users') } +RSpec.describe 'Ticket history', type: :system, time_zone: 'Europe/London', authenticated_as: :admin_de do + let(:group) { create(:group) } let(:ticket) { create(:ticket, group: group) } - let!(:session_user) { User.find_by(login: 'admin@example.com') } + let(:admin_de) { create(:admin, :groupable, preferences: { locale: 'de-de' }, group: group) } before do freeze_time @@ -35,9 +35,6 @@ RSpec.describe 'Ticket history', type: :system, time_zone: 'Europe/London' do travel_back - session_user.preferences[:locale] = 'de-de' - session_user.save! - # Suppress the modal dialog that invites to contributions for translations that are < 95% as this breaks the tests for de-de. page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"