mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 14:46:00 +08:00
28 lines
522 B
Ruby
28 lines
522 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe Doorkeeper::AccessTokensController, type: :controller do
|
|
login_user
|
|
|
|
let!(:access_token) do
|
|
subject.current_user.access_tokens.create(expires_in: 7500)
|
|
end
|
|
|
|
describe 'POST revoke' do
|
|
let(:params) do
|
|
{
|
|
id: access_token.id
|
|
}
|
|
end
|
|
|
|
let(:action) do
|
|
put :revoke, params: params
|
|
end
|
|
|
|
it 'revokes the access token' do
|
|
action
|
|
expect(access_token.reload.revoked_at).to_not be_nil
|
|
end
|
|
end
|
|
end
|