Files
ubicloud/spec/routes/api/cli/ps/connect_spec.rb
Jeremy Evans 05665fa159 Add cli ps {connect,disconnect} commands
This was not previously supported in the api, so add api support so the cli
can use it.

To keep changes small, this has the api routes match the web routes, so the
connect/disconnect cases are not consistent, as connect takes the id as a
parameter, and disconnect takes the id as a path segment.
2025-02-21 15:27:03 -08:00

18 lines
554 B
Ruby

# frozen_string_literal: true
require_relative "../spec_helper"
RSpec.describe Clover, "cli ps connect" do
before do
cli(%w[ps eu-central-h1/test-ps create])
cli(%w[ps eu-central-h1/test-ps2 create])
@ps1, @ps2 = PrivateSubnet.all
end
it "connects requested private subnet to this subnet" do
expect(ConnectedSubnet.count).to eq 0
expect(cli(%W[ps eu-central-h1/#{@ps1.name} connect #{@ps2.ubid}])).to eq "Connected private subnets with ids #{@ps2.ubid} and #{@ps1.ubid}\n"
expect(ConnectedSubnet.count).to eq 1
end
end