Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F449074
srv_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, 2:18 PM
Size
723 B
Mime Type
text/x-ruby
Expires
Sat, Apr 26, 2:18 PM (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
212443
Attached To
rWEBDNS WebDNS (edet4)
srv_test.rb
View Options
require
'test_helper'
class
SRVTest
<
ActiveSupport
::
TestCase
test
'saves'
do
rec
=
build
(
:srv
)
rec
.
valid?
assert_empty
rec
.
errors
assert
rec
.
save
end
test
'supports prio'
do
rec
=
build
(
:srv
)
assert
rec
.
supports_prio?
,
'supports prio'
end
[
0
,
10
,
65_535
,
].
each
{
|
prio
|
test
"valid prio
#{
prio
}
"
do
rec
=
build
(
:srv
,
prio
:
prio
)
rec
.
valid?
assert_empty
rec
.
errors
[
:prio
]
,
"
#{
prio
}
should be valid!"
end
}
[
-
10
,
65_535
+
1
,
'str'
,
].
each
{
|
prio
|
test
"invalid prio
#{
prio
}
"
do
rec
=
build
(
:srv
,
prio
:
prio
)
rec
.
valid?
assert_not_empty
rec
.
errors
[
:prio
]
,
"
#{
prio
}
should be invalid!"
end
}
end
Event Timeline
Log In to Comment