0
0
Fork 0

Convert settings/sessions spec controller->system (#34072)

This commit is contained in:
Matt Jankowski 2025-03-06 03:21:05 -05:00 committed by GitHub
parent debe6c0545
commit b021cfc91e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 33 deletions

View file

@ -0,0 +1,25 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Sessions' do
let(:user) { Fabricate(:user) }
let!(:session_activation) { Fabricate(:session_activation, user: user) }
before { sign_in(user) }
describe 'deleting a session' do
it 'deletes listed session activation from the auth page' do
visit edit_user_registration_path
expect(page)
.to have_title(I18n.t('settings.account_settings'))
expect { click_on(I18n.t('sessions.revoke')) }
.to change(SessionActivation, :count).by(-1)
expect { session_activation.reload }
.to raise_error(ActiveRecord::RecordNotFound)
expect(page)
.to have_content(I18n.t('sessions.revoke_success'))
end
end
end