Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F905149
a_test.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Aug 29, 9:33 PM
Size
597 B
Mime Type
text/x-ruby
Expires
Sun, Aug 31, 9:33 PM (6 h, 3 m)
Engine
blob
Format
Raw Data
Handle
252506
Attached To
rWEBDNS WebDNS (edet4)
a_test.rb
View Options
require
'test_helper'
class
ATest
<
ActiveSupport
::
TestCase
[
'0.0.0.0'
,
'1.2.3.4'
,
'255.255.255.255'
,
].
each
{
|
ip
|
test
"content valid
#{
ip
}
"
do
rec
=
build
(
:a
,
content
:
ip
)
rec
.
valid?
assert_empty
rec
.
errors
[
:content
]
,
"
#{
ip
}
should be valid!"
end
}
[
'noip'
,
'no ip'
,
'1.2'
,
'1.2.3.4.5'
,
'1.2.3.256'
,
'1.2.3.4/24'
,
'::1'
,
].
each
{
|
ip
|
test
"content invalid
#{
ip
}
"
do
rec
=
build
(
:a
,
content
:
ip
)
rec
.
valid?
assert_not_empty
rec
.
errors
[
:content
]
,
"
#{
name
}
should be invalid!"
end
}
end
Event Timeline
Log In to Comment