Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F401847
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
Thu, Feb 20, 1:37 PM
Size
597 B
Mime Type
text/x-ruby
Expires
Sat, Feb 22, 1:37 PM (19 h, 7 m)
Engine
blob
Format
Raw Data
Handle
191826
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