From da7cffd7bc5935235037964d37445004c2f75fa9 Mon Sep 17 00:00:00 2001 From: Mantas Date: Tue, 16 Jun 2020 00:26:06 +0300 Subject: [PATCH] Maintenance: Make login message system spec more stable by using default wait time to prevent WS event race condition. --- spec/system/login/message_spec.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/system/login/message_spec.rb b/spec/system/login/message_spec.rb index 209c95899..2821a9cb9 100644 --- a/spec/system/login/message_spec.rb +++ b/spec/system/login/message_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do it 'shows message' do open_login_page - expect(page).to have_text(message) + expect(page).to have_css('.js-maintenanceLogin', text: message) end it 'hides message on the go' do @@ -21,7 +21,7 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do Setting.set 'maintenance_login', false - expect(page).to have_no_css('.js-maintenanceLogin', text: message, wait: 10) + expect(page).to have_no_css('.js-maintenanceLogin', text: message) end it 'changes message text on the go' do @@ -29,7 +29,7 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do Setting.set 'maintenance_login_message', alt_message - expect(page).to have_css('.js-maintenanceLogin', text: alt_message, wait: 10) + expect(page).to have_css('.js-maintenanceLogin', text: alt_message) end end @@ -47,8 +47,6 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do Setting.set 'maintenance_login', true - wait(10).until_exists { find '.js-maintenanceLogin', text: message, wait: false } - expect(page).to have_css('.js-maintenanceLogin', text: message) end end