diff options
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r-- | spec/models/key_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 7758b7ffa97..5eaddd822be 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -28,6 +28,15 @@ describe Key, models: true do expect(build(:key, user: user).publishable_key).to include("#{user.name} (#{Gitlab.config.gitlab.host})") end end + + describe "#update_last_used_at" do + it "enqueues a UseKeyWorker job" do + key = create(:key) + + expect(UseKeyWorker).to receive(:perform_async).with(key.id) + key.update_last_used_at + end + end end context "validation of uniqueness (based on fingerprint uniqueness)" do |