ubicloud/spec/routes/api/cli/vm/restart_spec.rb
Jeremy Evans 138b2e98b7 Add cli vm restart command
This was not previously supported in the api, so add api support
so the cli can use it.
2025-02-21 15:27:03 -08:00

16 lines
490 B
Ruby

# frozen_string_literal: true
require_relative "../spec_helper"
RSpec.describe Clover, "cli vm restart" do
before do
cli(%w[vm eu-central-h1/test-vm create a])
@vm = Vm.first
end
it "restarts vm" do
expect(Semaphore.where(strand_id: @vm.id, name: "restart")).to be_empty
expect(cli(%w[vm eu-central-h1/test-vm restart])).to eq "Scheduled restart of VM with id #{@vm.ubid}\n"
expect(Semaphore.where(strand_id: @vm.id, name: "restart")).not_to be_empty
end
end