From 3a76defc83c402a160b6a20fa84085e1163add6a Mon Sep 17 00:00:00 2001 From: Dominik Klein Date: Fri, 10 Dec 2021 09:38:53 +0100 Subject: [PATCH] Maintenance: Try to improve the stabilzation of the cti selenium test. --- spec/system/cti_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/system/cti_spec.rb b/spec/system/cti_spec.rb index 7248d0abc..e02affcc7 100644 --- a/spec/system/cti_spec.rb +++ b/spec/system/cti_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe 'Caller log', type: :system, authenticated_as: :agent do +RSpec.describe 'Caller log', type: :system, authenticated_as: :authenticate do let(:agent_phone) { '0190111' } let(:customer_phone) { '0190333' } let(:cti_token) { 'token1234' } @@ -28,12 +28,13 @@ RSpec.describe 'Caller log', type: :system, authenticated_as: :agent do post "#{Capybara.app_host}/api/v1/cti/#{cti_token}", params: second_params end - let(:prepare) do + # Do the preperation before the authentication. + def authenticate Setting.set('cti_integration', cti_on) Setting.set('cti_token', cti_token) - end - before { prepare } + agent + end context 'when cti integration is on' do it 'shows the phone menu in nav bar' do