Files
ubicloud/spec/routes/api/cli/ai/api-key/destroy_spec.rb
Jeremy Evans 045837597c Add cli ai api-key commands
The following commands are supported:

* ai api-key list
* ai api-key create
* ai api-key api-key-id show
* ai api-key api-key-id destroy

To get the golden files spec passing, add ApiKey.random_key, so it can
be overridden to provide a consistent key for the specs.
2025-05-03 03:33:32 +09:00

13 lines
318 B
Ruby

# frozen_string_literal: true
require_relative "../../spec_helper"
RSpec.describe Clover, "cli ai api-key destroy" do
it "destroys api key" do
cli(%w[ai api-key create])
iak = ApiKey.first(owner_table: "project")
cli(%W[ai api-key #{iak.ubid} destroy -f])
expect(iak.exists?).to be false
end
end