Files
ubicloud/spec/routes/api/cli/pg/restart_spec.rb
Jeremy Evans babcd5dbdc Add cli pg 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

18 lines
662 B
Ruby

# frozen_string_literal: true
require_relative "../spec_helper"
RSpec.describe Clover, "cli pg restart" do
before do
expect(Config).to receive(:postgres_service_project_id).and_return(@project.id).at_least(:once)
cli(%w[pg eu-central-h1/test-pg create])
@pg = PostgresResource.first
end
it "restarts postgres database" do
expect(Semaphore.where(strand_id: @pg.servers.first.id, name: "restart")).to be_empty
expect(cli(%w[pg eu-central-h1/test-pg restart])).to eq "Scheduled restart of PostgreSQL database with id #{@pg.ubid}\n"
expect(Semaphore.where(strand_id: @pg.servers.first.id, name: "restart")).not_to be_empty
end
end