Cross Reference: ontology_type_spec.rb
xref
: /
ontohub
/
spec
/
models
/
ontology_type_spec.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
require
'spec_helper'
describe
OntologyType
do
context
'Migrations'
do
%w
(
name
description
documentation
)
.
each
do
|
column
|
it
{
should
have_db_column
(
column
)
.
of_type
(:
text
)
}
end
it
{
should
have_db_index
(:
name
)
.
unique
(
true
)
}
end
context
'Validations'
do
[
'
http://example.com/
'
,
'
https://example.com/
'
,
'file://
path
/
to
/
file
'
].
each
do
|
val
|
it
{
should
allow_value
(
val
)
.
for
:
documentation
}
end
end
[
nil
,
''
,
'fooo'
].
each
do
|
val
|
it
{
should_not
allow_value
(
val
)
.
for
:
documentation
}
end
end