Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1300565
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
Wed, Nov 19, 2:22 PM
Size
723 B
Mime Type
text/x-ruby
Expires
Fri, Nov 21, 2:22 PM (4 h, 9 m)
Engine
blob
Format
Raw Data
Handle
292916
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