Skip to content

Commit

Permalink
updated functional tests to use the irregular .ttl test case #2134
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Mar 10, 2025
1 parent 51a9062 commit ae7b991
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/functional/extended_metadata_types_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class ExtendedMetadataTypesControllerTest < ActionController::TestCase
assert person.is_admin?
login_as(person)

file = fixture_file_upload('fair_data_station/seek-fair-data-station-test-case.ttl', 'text/turtle')
file = fixture_file_upload('fair_data_station/seek-fair-data-station-test-case-irregular.ttl', 'text/turtle')

assert_no_difference('ExtendedMetadataType.count') do
post :create_from_fair_ds_ttl, params: { emt_fair_ds_ttl_file: file }
Expand Down
9 changes: 6 additions & 3 deletions test/functional/sample_types_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class SampleTypesControllerTest < ActionController::TestCase
end

test 'create from fair data station ttl' do
blob = { data: fixture_file_upload('fair_data_station/seek-fair-data-station-test-case.ttl', 'text/turtle') }
blob = { data: fixture_file_upload('fair_data_station/seek-fair-data-station-test-case-irregular.ttl', 'text/turtle') }
FactoryBot.create(:string_sample_attribute_type, title: 'String') unless SampleAttributeType.where(title: 'String').any?
assert_difference('ActivityLog.count', 1) do
assert_difference('SampleType.count', 1) do
Expand All @@ -465,8 +465,11 @@ class SampleTypesControllerTest < ActionController::TestCase

assert_equal 6, sample_type.sample_attributes.count

assert_equal ["http://schema.org/name", "http://schema.org/description", "http://fairbydesign.nl/ontology/biosafety_level", "http://gbol.life/0.1/scientificName", "http://purl.uniprot.org/core/organism", "https://w3id.org/mixs/0000011"], sample_type.sample_attributes.collect(&:pid)
assert_equal ["Title", "Description", "biosafety level", "scientific name", "ncbi taxonomy id", "collection date"], sample_type.sample_attributes.collect(&:title)
expected = ["http://schema.org/name", "http://schema.org/description", "http://fairbydesign.nl/ontology/biosafety_level", "http://gbol.life/0.1/scientificName", "http://purl.uniprot.org/core/organism", "https://w3id.org/mixs/0000011"].sort
assert_equal expected, sample_type.sample_attributes.collect(&:pid).sort

expected = ["Title", "Description", "biosafety level", "scientific name", "ncbi taxonomy id", "collection date"].sort
assert_equal expected, sample_type.sample_attributes.collect(&:title).sort
end

test 'create from empty fair data station ttl' do
Expand Down

0 comments on commit ae7b991

Please sign in to comment.