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

This commit is contained in:
Matt Jankowski authored and GitHub committed 2025-03-06 08:21:05 +00:00
1 parent debe6c0545
commit b021cfc91e
3 files changed
+45 -33

No files matched your search

+25
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