diff --git a/test/controllers/test_schemes_controller.rb b/test/controllers/test_schemes_controller.rb index ebabc42f..874e131b 100644 --- a/test/controllers/test_schemes_controller.rb +++ b/test/controllers/test_schemes_controller.rb @@ -61,4 +61,22 @@ def test_calls_not_found assert_equal 404, last_response.status end + + def test_class_tree + ont = Ontology.find('INRAETHES-0').include(:acronym).first + sub = ont.latest_submission + concept_schemes = ["http://opendata.inrae.fr/thesaurusINRAE/domainesINRAE"] + sub.bring_remaining + sub.uri = RDF::URI.new('http://opendata.inrae.fr/thesaurusINRAE/domainesINRAE') + sub.hasOntologyLanguage = LinkedData::Models::OntologyFormat.find('SKOS').first + sub.save + + cls = 'http://opendata.inrae.fr/thesaurusINRAE/d_6' + get "ontologies/INRAETHES-0/classes/#{CGI.escape(cls)}/tree?concept_schemes=#{concept_schemes.join(',')}&concept_collections=#{concept_schemes.join(',')}" + + classes = MultiJson.load(last_response.body) + + refute_nil classes.select{|x| x['@id'].eql?(cls)}.first['isInActiveScheme'] + refute_nil classes.select{|x| x['@id'].eql?(cls)}.first['isInActiveCollection'] + end end