2020-09-03 11:15:55 +05:30
|
|
|
# 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)
|
2021-03-05 16:19:46 +05:30
|
|
|
session_id = request.session.id.private_id
|
2020-09-03 11:15:55 +05:30
|
|
|
user.remember_me!
|
|
|
|
|
|
|
|
delete :destroy, params: { id: session_id }
|
|
|
|
|
|
|
|
expect(user.reload.remember_created_at).to be_nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|