Files
ubicloud/spec/model/firewall_rule_spec.rb
Furkan Sahin 12dbeb57a1 Update location references with foreign key in the controlplane
We are basically updating the location references everywhere with a
location id and adding the location relationship to the models to be
able to fetch location names when needed.
This also makes the LocationNameConverter model obsolete, so we are
removing it.

Use model id as value for Sequel::Model in resource creation form

Use id of the location as preselected value in Postgres update form
2025-03-23 15:48:19 +01:00

17 lines
457 B
Ruby

# frozen_string_literal: true
require_relative "spec_helper"
RSpec.describe FirewallRule do
let(:fw) {
Firewall.create_with_id(location_id: Location::HETZNER_FSN1_ID, project_id: Project.create(name: "test").id)
}
it "returns ip6? properly" do
fw_rule = described_class.create_with_id(cidr: "::/0", firewall_id: fw.id)
expect(fw_rule.ip6?).to be true
fw_rule.update(cidr: "0.0.0.0/0")
expect(fw_rule.ip6?).to be false
end
end