ubicloud/spec/routes/api/cli/pg/rename_spec.rb
Jeremy Evans b3d8a774b1 Add support for renaming objects to api/sdk/cli
This uses a shared route for all 6 objects, as well as shared
cli and sdk code. Unfortunately, there is not a way to share
such code in openapi.yml, so that part ends up quite verbose.

Eventually, we should add a web interface for this, but it's
best to wait until we refactor the web interfaces for the objects
to consistently use the current postgres web interface.
2025-08-26 02:54:13 +09:00

12 lines
490 B
Ruby

# frozen_string_literal: true
require_relative "../spec_helper"
RSpec.describe Clover, "cli pg rename" do
it "renames PostgreSQL database" 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 -s standard-2 -S 64])
expect(cli(%w[pg eu-central-h1/test-pg rename new-name])).to eq "PostgreSQL database renamed to new-name\n"
expect(PostgresResource.first.name).to eq "new-name"
end
end