Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F449015
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, Apr 24, 1:16 PM
Size
597 B
Mime Type
text/x-ruby
Expires
Sat, Apr 26, 1:16 PM (1 d, 16 h)
Engine
blob
Format
Raw Data
Handle
212300
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