Revision 9d43fc71
Added by Michael Moll almost 6 years ago
test/models/subnet/ipv4_test.rb | ||
---|---|---|
end
|
||
|
||
test "should be able to save ranges" do
|
||
s=subnets(:one)
|
||
s = subnets(:one)
|
||
s.from = "2.3.4.15"
|
||
s.to = "2.3.4.17"
|
||
assert s.save
|
||
end
|
||
|
||
test "should not be able to save ranges if they dont belong to the subnet" do
|
||
s=subnets(:one)
|
||
s = subnets(:one)
|
||
s.from = "2.3.3.15"
|
||
s.to = "2.3.4.17"
|
||
assert !s.save
|
||
end
|
||
|
||
test "should not be able to save ranges if one of them is missing" do
|
||
s=subnets(:one)
|
||
s = subnets(:one)
|
||
s.from = "2.3.4.15"
|
||
assert !s.save
|
||
s.to = "2.3.4.17"
|
||
s.to = "2.3.4.17"
|
||
assert s.save
|
||
end
|
||
|
||
test "should not be able to save ranges if one of them is invalid" do
|
||
s=subnets(:one)
|
||
s = subnets(:one)
|
||
s.from = "2.3.4.abc"
|
||
s.to = "2.3.4.17"
|
||
refute s.valid?
|
Also available in: Unified diff
Fixes #19789 - fix Layout/SpaceAroundOperators cop