Skip to content

Commit

Permalink
add test for mappings statistics slices support
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed May 21, 2024
1 parent 8a212e5 commit aa9c766
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
5 changes: 0 additions & 5 deletions test/controllers/test_mappings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ def test_mappings_file_load
commun_created_mappings_test(created, mapping_term_a, mapping_term_b, relations)
end

def test_mappings_slices
get "/mappings/statistics/ontologies/"


end

private

Expand Down
25 changes: 25 additions & 0 deletions test/helpers/test_slices_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,31 @@ def test_search_slices
assert results.all? {|r| group_ids.include?(r["links"]["ontology"])}
end

def test_mappings_slices
LinkedData::Mappings.create_mapping_counts(Logger.new(TestLogFile.new))

get "/mappings/statistics/ontologies/"

expected_result_without_slice = ["PARSED-0",
"PARSED-1",
"http://data.bioontology.org/metadata/ExternalMappings",
"http://data.bioontology.org/metadata/InterportalMappings/agroportal",
"http://data.bioontology.org/metadata/InterportalMappings/ncbo",
"http://data.bioontology.org/metadata/InterportalMappings/sifr"]

assert_equal expected_result_without_slice, MultiJson.load(last_response.body).keys.sort

get "http://#{@@group_acronym}/mappings/statistics/ontologies/"

expected_result_with_slice = ["PARSED-0",
"http://data.bioontology.org/metadata/ExternalMappings",
"http://data.bioontology.org/metadata/InterportalMappings/agroportal",
"http://data.bioontology.org/metadata/InterportalMappings/ncbo",
"http://data.bioontology.org/metadata/InterportalMappings/sifr"]

assert_equal expected_result_with_slice, MultiJson.load(last_response.body).keys.sort
end

private

def self._create_group
Expand Down

0 comments on commit aa9c766

Please sign in to comment.