These three specs files use the pattern: ```ruby RSpec.describe ClassName do describe "ClassName" do ``` This is redundant and unnecessary. Drop the `describe "ClassName" do`. There are many other cases where we could drop unnecessary spec subclasses (any nested describe/context blocks not using before/after/let/etc. can be folded into the containing block), but as those could potentially be useful for grouping (even if I don't think the tradeoff is worth it), I am not modifying those.
17 lines
443 B
Ruby
17 lines
443 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "spec_helper"
|
|
|
|
RSpec.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
|