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..d61c54aa 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: f9c6c38f86db1131278137829d837cf756a9d77a 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) @@ -165,14 +165,14 @@ GEM faraday-rack (1.0.0) faraday-retry (1.0.3) ffi (1.16.3) - gapic-common (0.21.1) + gapic-common (0.22.0) faraday (>= 1.9, < 3.a) faraday-retry (>= 1.0, < 3.a) - google-protobuf (~> 3.18) - googleapis-common-protos (>= 1.4.0, < 2.a) - googleapis-common-protos-types (>= 1.11.0, < 2.a) - googleauth (~> 1.9) - grpc (~> 1.59) + google-protobuf (>= 3.25, < 5.a) + googleapis-common-protos (~> 1.6) + googleapis-common-protos-types (~> 1.15) + googleauth (~> 1.11) + grpc (~> 1.65) get_process_mem (0.2.7) ffi (~> 1.0) google-analytics-data (0.6.1) @@ -194,9 +194,10 @@ GEM google-cloud-core (1.7.1) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (2.1.1) + google-cloud-env (2.2.1) faraday (>= 1.0, < 3.a) google-cloud-errors (1.4.0) + google-protobuf (3.25.3) google-protobuf (3.25.3-x86_64-linux) googleapis-common-protos (1.6.0) google-protobuf (>= 3.18, < 5.a) @@ -204,14 +205,17 @@ 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) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - grpc (1.65.2-x86_64-linux) + grpc (1.67.0) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.67.0-x86_64-linux) google-protobuf (>= 3.25, < 5.0) googleapis-common-protos-types (~> 1.0) haml (5.2.2) @@ -231,7 +235,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 +249,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 +263,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 +276,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 @@ -286,7 +291,7 @@ GEM pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.1.1) + public_suffix (6.0.1) rack (1.6.13) rack-accept (0.4.5) rack (>= 0.4) @@ -342,7 +347,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 +383,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) @@ -406,6 +411,7 @@ GEM hashdiff (>= 0.4.0, < 2.0.0) PLATFORMS + ruby x86_64-linux DEPENDENCIES 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