Cross Reference: category.rb
xref
: /
ontohub
/
spec
/
models
/
category.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
category.rb revision 4b877c7fc20df8e59cd2bef9a37f96ce9a530fa1
require
'spec_helper'
describe
Category
do
context
"get ontologies of a category and subcategories"
do
before
{
edge
=
FactoryGirl.create
(:
c_edge
)
onto1
=
FactoryGirl.create
(:
ontology
)
onto2
=
FactoryGirl.create
(:
ontology
)
onto1.categories
= [
Category.find
(
edge.parent
_id
)
]
onto1.save
!
onto2.categories
= [
Category.find
(
edge.child
_id
)
]
onto2.save
!
@
parent_category
=
Category.find
(
edge.parent
_id
)
@
child_category
=
Category.find
(
edge.child
_id
)
}
it
{
@
parent_category.related_ontologies.count.should
==
2
}
it
{
@
child_category.related_ontologies.count.should
==
1
}
end
end