mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
0653750fbf
The 'key' column will be dropped in a future commit.
19 lines
439 B
Ruby
19 lines
439 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe 'user api keys integration' do
|
|
it 'updates last used time on use' do
|
|
freeze_time
|
|
|
|
user_api_key = Fabricate(:readonly_user_api_key)
|
|
user_api_key.update_columns(last_used_at: 7.days.ago)
|
|
|
|
get '/session/current.json', headers: {
|
|
HTTP_USER_API_KEY: user_api_key.key,
|
|
}
|
|
|
|
expect(user_api_key.reload.last_used_at).to eq_time(Time.zone.now)
|
|
end
|
|
end
|