diff --git a/spec/support/capybara/common_actions.rb b/spec/support/capybara/common_actions.rb index d9e640221af3..309b422c59c2 100644 --- a/spec/support/capybara/common_actions.rb +++ b/spec/support/capybara/common_actions.rb @@ -92,6 +92,8 @@ def current_user # def logout visit('logout') + + wait.until_disappears { find('.user-menu .user a', wait: false) } end # Overwrites the Capybara::Session#visit method to allow SPA navigation diff --git a/spec/system/ticket/create_spec.rb b/spec/system/ticket/create_spec.rb index 2988643d3425..f4776874b484 100644 --- a/spec/system/ticket/create_spec.rb +++ b/spec/system/ticket/create_spec.rb @@ -535,8 +535,7 @@ def authenticate let(:customer) { create(:customer, password: 'test') } it 'customer user should not have agent object attributes', authenticated_as: :agent do - visit 'ticket/create' - + # Log out again, so that we can execute the next login. logout # Re-create agent session and fetch object attributes.