24 lines
507 B
Ruby
24 lines
507 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require 'spec_helper'
|
||
|
|
||
|
RSpec.describe Profiles::ActiveSessionsController do
|
||
|
describe 'DELETE destroy' do
|
||
|
let_it_be(:user) { create(:user) }
|
||
|
|
||
|
before do
|
||
|
sign_in(user)
|
||
|
end
|
||
|
|
||
|
it 'invalidates all remember user tokens' do
|
||
|
ActiveSession.set(user, request)
|
||
|
session_id = request.session.id.public_id
|
||
|
user.remember_me!
|
||
|
|
||
|
delete :destroy, params: { id: session_id }
|
||
|
|
||
|
expect(user.reload.remember_created_at).to be_nil
|
||
|
end
|
||
|
end
|
||
|
end
|