category.rb revision 6b0302da488ae6af64bcee37c0688f79d44668ce
7cb128dc4cae2a03a742f63ba7afee23c78e3af0Phil Carmodyrequire 'spec_helper'
31d32d39dd09be0625a6d92ee715155f5d679515Timo Sirainen it { should have_db_column('name').of_type(:text) }
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen context 'get ontologies of a category and subcategories' do
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen onto1.categories = [Category.find(edge.parent_id)]
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen onto2.categories = [Category.find(edge.child_id)]
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen @parent_category = Category.find(edge.parent_id)
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen @child_category = Category.find(edge.child_id)
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen it 'parent ontology should have 2 related ontologies' do
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen @parent_category.related_ontologies.count.should == 2
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen it 'child ontology should have 1 related ontology' do
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen @child_category.related_ontologies.count.should == 1
d9b9687bf8cae9cfb070b1b7aadefa683220269fTimo Sirainen context 'creation of categories from ontology' do
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen parse_this(@user, @ontology, fixture_file('Domain_Fields_Core.xml'), fixture_file('Domain_Fields_Core.pp.xml'))
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen it 'should be the correct categories count' do
9eef11df882f9c14d164f42cb438f32fe724041cTimo Sirainen it 'should be the correct category edges count' do