session_takeover_spec.rb 638 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Session takeover check', type: :system do
  4. context 'when use logout action' do
  5. let(:agent) { create(:agent) }
  6. it 'check that all tabs have been logged out', authenticated_as: :agent do
  7. visit '/'
  8. # open new tab
  9. open_window_and_switch
  10. visit '/'
  11. # Go back and check for session takeover message
  12. switch_to_window_index(1)
  13. expect(page).to have_text('A new session was created with your account. This session will be stopped to prevent a conflict.')
  14. end
  15. end
  16. end