diff --git a/spec/support/capybara/common_actions.rb b/spec/support/capybara/common_actions.rb index d9e640221..309b422c5 100644 --- a/spec/support/capybara/common_actions.rb +++ b/spec/support/capybara/common_actions.rb @@ -92,6 +92,8 @@ module CommonActions # 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 2988643d3..f4776874b 100644 --- a/spec/system/ticket/create_spec.rb +++ b/spec/system/ticket/create_spec.rb @@ -535,8 +535,7 @@ RSpec.describe 'Ticket Create', type: :system do 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.