tarjan_spec.rb revision 56cef2d91f243b2b1f773acc20f9c5ae9fb5c537
6da407b2e43a613ec833f14d8c05d4494a27f17asliverequire 'spec_helper'
6da407b2e43a613ec833f14d8c05d4494a27f17aslive
6da407b2e43a613ec833f14d8c05d4494a27f17aslivedescribe TarjanTree do
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd
acc36ab93565d2880447d535da6ca6e5feac7a70nd context 'owl classhierachy' do
acc36ab93565d2880447d535da6ca6e5feac7a70nd let(:ontology) { create :ontology }
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding let(:user) { create :user }
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding let(:xml_path) { Rails.root + 'test/fixtures/ontologies/xml/' + 'cycle.xml' }
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding before do
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding parse_this(user, ontology, xml_path, nil)
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding ontology.reload
acc36ab93565d2880447d535da6ca6e5feac7a70nd end
acc36ab93565d2880447d535da6ca6e5feac7a70nd
acc36ab93565d2880447d535da6ca6e5feac7a70nd it 'should have an entity-tree' do
acc36ab93565d2880447d535da6ca6e5feac7a70nd ontology.entity_groups.size.should == 3
acc36ab93565d2880447d535da6ca6e5feac7a70nd entities = ontology.entities.where(name: ["B1","B2","B3"])
acc36ab93565d2880447d535da6ca6e5feac7a70nd expect(ontology.entity_groups.includes(:entities).where("entities.id" => entities).first).not_to be_nil
acc36ab93565d2880447d535da6ca6e5feac7a70nd end
acc36ab93565d2880447d535da6ca6e5feac7a70nd
acc36ab93565d2880447d535da6ca6e5feac7a70nd it 'should have an congruence node' do
acc36ab93565d2880447d535da6ca6e5feac7a70nd ontology.entity_groups.where("name LIKE '%☰%'")
7db9f691a00ead175b03335457ca296a33ddf31bnd end
6da407b2e43a613ec833f14d8c05d4494a27f17aslive
6da407b2e43a613ec833f14d8c05d4494a27f17aslive end
6da407b2e43a613ec833f14d8c05d4494a27f17aslive
6da407b2e43a613ec833f14d8c05d4494a27f17asliveend
654d8eb036bedc99e90e11910ee02d3421417697rbowen