It hasn't been necessary to use create_with_id since
ebc79622df
, in December 2024.
I have plans to introduce:
```ruby
def create_with_id(id, values)
obj = new(values)
obj.id = id
obj.save_changes
end
```
This will make it easier to use the same id when creating
multiple objects. The first step is removing the existing
uses of create_with_id.
17 lines
441 B
Ruby
17 lines
441 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "spec_helper"
|
|
|
|
RSpec.describe FirewallRule do
|
|
let(:fw) {
|
|
Firewall.create(location_id: Location::HETZNER_FSN1_ID, project_id: Project.create(name: "test").id)
|
|
}
|
|
|
|
it "returns ip6? properly" do
|
|
fw_rule = described_class.create(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
|