From 9689d3d97ef42d11d474e3648c44cf3522e13c81 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Mon, 27 Sep 2021 10:17:56 +0200 Subject: [PATCH] Maintenance: Stabilize System > Objects test (another try). --- spec/system/system/object_manager_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/system/system/object_manager_spec.rb b/spec/system/system/object_manager_spec.rb index da687e8ba..3fa859bdc 100644 --- a/spec/system/system/object_manager_spec.rb +++ b/spec/system/system/object_manager_spec.rb @@ -217,6 +217,11 @@ RSpec.describe 'System > Objects', type: :system do # Make sure option is still available in already saved ticket, even though the option was removed from the object attribute. # This is done via the :historical_options. visit "/#ticket/zoom/#{ticket.id}" + + # Ticket data is loaded from a front end cache first, so wait until there is a consistent state. + expect(page).to have_css("select[name=#{object_attribute.name}] option[value='delete']") + expect(page).to have_no_css("select[name=#{object_attribute.name}] option[value='dog']") + sorted_ticket_values = all("select[name=#{object_attribute.name}] option").map(&:value).reject { |x| x == '' } expect(sorted_ticket_values).to eq(options_no_dog.keys) expect(find("select[name=#{object_attribute.name}] option:checked").value).to eq('delete')