diff --git a/Gemfile b/Gemfile index 1c87860c..de4be286 100644 --- a/Gemfile +++ b/Gemfile @@ -51,7 +51,7 @@ gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branc gem 'ncbo_ontology_recommender', git: 'https://github.com/ncbo/ncbo_ontology_recommender.git', branch: 'master' gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development' gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'development' -gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'feature/parse-diff-files' +gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'development' group :development do # bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42 diff --git a/Gemfile.lock b/Gemfile.lock index 34f0734a..2470fac9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/ncbo_ontology_recommender.git - revision: 013abea4af3b10910ec661dbb358a4b6cae198a4 + revision: 9dbd4f179e42c52095129d353a5ac584e9bd47f3 branch: master specs: ncbo_ontology_recommender (0.0.1) @@ -11,7 +11,7 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/goo.git - revision: a95245b8c964431505ca6315907440996c59a00d + revision: 6018b33373467b778744432ec78a6d814159d129 branch: development specs: goo (0.0.2) @@ -57,8 +57,8 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git - revision: d69ede0a0b3e3c5dee64fa75cb09cc6e16e0f4b5 - branch: feature/parse-diff-files + revision: 0a456557bc0ae2a7d016000de9b57d3f9eca99a5 + branch: development specs: ontologies_linked_data (0.0.1) activesupport @@ -141,7 +141,7 @@ GEM docile (1.4.1) domain_name (0.6.20240107) ed25519 (1.3.0) - faraday (1.10.3) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -204,7 +204,7 @@ GEM grpc (~> 1.41) googleapis-common-protos-types (1.16.0) google-protobuf (>= 3.18, < 5.a) - googleauth (1.11.0) + googleauth (1.11.1) faraday (>= 1.0, < 3.a) google-cloud-env (~> 2.1) jwt (>= 1.4, < 3.0) @@ -231,7 +231,7 @@ GEM rdf (>= 2.2.8, < 4.0) json-schema (2.8.1) addressable (>= 2.4) - jwt (2.9.0) + jwt (2.9.3) base64 kgio (2.11.4) libxml-ruby (5.0.3) @@ -245,9 +245,10 @@ GEM net-pop net-smtp method_source (1.1.0) - mime-types (3.5.2) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.0903) + mime-types-data (3.2024.1001) mini_mime (1.1.5) minitest (4.7.5) minitest-stub_any_instance (1.0.3) @@ -258,7 +259,7 @@ GEM mutex_m (0.2.0) net-http-persistent (4.0.4) connection_pool (~> 2.2) - net-imap (0.4.16) + net-imap (0.4.17) date net-protocol net-pop (0.1.2) @@ -271,9 +272,9 @@ GEM net-ssh (>= 5.0.0, < 8.0.0) net-smtp (0.5.0) net-protocol - net-ssh (7.2.3) + net-ssh (7.3.0) netrc (0.11.0) - newrelic_rpm (9.13.0) + newrelic_rpm (9.14.0) oj (3.16.1) omni_logger (0.1.4) logger @@ -342,7 +343,7 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retriable (3.1.2) - rexml (3.3.7) + rexml (3.3.8) rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) @@ -378,7 +379,7 @@ GEM rack-test sinatra (~> 1.4.0) tilt (>= 1.3, < 3) - sshkit (1.23.1) + sshkit (1.23.2) base64 net-scp (>= 1.1.2) net-sftp (>= 2.1.2) @@ -464,4 +465,4 @@ DEPENDENCIES webmock (~> 3.19.1) BUNDLED WITH - 2.3.23 + 2.4.22 diff --git a/test/controllers/test_categories_controller.rb b/test/controllers/test_categories_controller.rb index d7e07cd2..4cfa7a0b 100644 --- a/test/controllers/test_categories_controller.rb +++ b/test/controllers/test_categories_controller.rb @@ -117,4 +117,34 @@ def test_delete_category get "/categories/#{acronym}" assert last_response.status == 404 end -end \ No newline at end of file + + def test_parent_category + parent_category1 = LinkedData::Models::Category.new( + acronym: "PARENT1", + name: "Parent Category 1", + description: "Description for Parent Category 1." + ) + parent_category1.save + + parent_category2 = LinkedData::Models::Category.new( + acronym: "PARENT2", + name: "Parent Category 2", + description: "Description for Parent Category 2." + ) + parent_category2.save + + category_instance = LinkedData::Models::Category.new( + acronym: "CAT123", + name: "Sample Category", + description: "This is a sample category.", + parentCategory: [parent_category1, parent_category2] + ) + category_instance.save + + get '/categories/CAT123' + fetched_category = MultiJson.load(last_response.body) + + assert_equal fetched_category["parentCategory"].first , parent_category1.id.to_s + assert_equal fetched_category["parentCategory"].last , parent_category2.id.to_s + end +end