mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-05 14:23:03 +08:00
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.
24 lines
778 B
Ruby
24 lines
778 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../spec_helper"
|
|
|
|
RSpec.describe Clover, "cli fw rename" do
|
|
before do
|
|
cli(%w[fw eu-central-h1/test-fw create])
|
|
@fw = Firewall.first
|
|
end
|
|
|
|
it "renames object" do
|
|
expect(cli(%w[fw eu-central-h1/test-fw rename new-name])).to eq "Firewall renamed to new-name\n"
|
|
expect(@fw.reload.name).to eq "new-name"
|
|
end
|
|
|
|
it "handles failure when renaming object" do
|
|
expect(cli(%w[fw eu-central-h1/test-fw rename] << "new name", status: 400)).to eq <<~END
|
|
! Unexpected response status: 400
|
|
Details: Validation failed for following fields: name
|
|
name: Name must only contain lowercase letters, numbers, and hyphens and have max length 63.
|
|
END
|
|
expect(@fw.reload.name).to eq "test-fw"
|
|
end
|
|
end
|