Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1615427
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
Sun, Mar 22, 12:49 AM
Size
723 B
Mime Type
text/x-ruby
Expires
Tue, Mar 24, 12:49 AM (2 h, 19 m)
Engine
blob
Format
Raw Data
Handle
354410
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