Cross Reference: category.rb
xref
: /
ontohub
/
spec
/
models
/
category.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
category.rb revision 11171d2085000030855bde5557072ba908e73435
require
'spec_helper'
describe
Category
do
context
"get ontologies of a category and subcategories"
do
before
do
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
)
end
it
do
@
parent_category.related_ontologies.count.should
==
2
end
it
do
@
child_category.related_ontologies.count.should
==
1
end
end
end