These columns are now populated and required during insert. This causes a large amount of fallout in the specs, as there were many places that inserted rows without having a related project. No changes outside the specs except for ApiKey#create_personal_access_token, which now requires a project keyword argument, since the method would fail without it now (the was previously optional).
19 lines
496 B
Ruby
19 lines
496 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "spec_helper"
|
|
|
|
RSpec.describe FirewallRule do
|
|
describe "FirewallRule" do
|
|
let(:fw) {
|
|
Firewall.create_with_id(location: "hetzner-fsn1", 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
|
|
end
|