From 598161b7d14460d8228a4861200d293a3ed97bfe Mon Sep 17 00:00:00 2001 From: Stuart Owen Date: Fri, 19 Jul 2024 14:59:40 +0100 Subject: [PATCH] test for tags and dont show attributions in edit and create forms #1961 --- app/views/observation_units/edit.html.erb | 2 +- app/views/observation_units/new.html.erb | 2 +- test/functional/observation_units_controller_test.rb | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/observation_units/edit.html.erb b/app/views/observation_units/edit.html.erb index ad887776cd..54e1f61361 100644 --- a/app/views/observation_units/edit.html.erb +++ b/app/views/observation_units/edit.html.erb @@ -19,7 +19,7 @@ <%= render partial: 'extended_metadata/extended_metadata_attribute_input', locals: { f: f, resource: @observation_unit } %> - <%= render partial: "assets/asset_form_bottom", locals: {show_publications:false, f: f}-%> + <%= render partial: "assets/asset_form_bottom", locals: {show_publications:false, attribution_enable: false, f: f}-%> <%= form_submit_buttons(@observation_unit) %> diff --git a/app/views/observation_units/new.html.erb b/app/views/observation_units/new.html.erb index a011521735..ab97b08f65 100644 --- a/app/views/observation_units/new.html.erb +++ b/app/views/observation_units/new.html.erb @@ -26,7 +26,7 @@ <%= resource_study_selection('observation_unit[study_id]', @observation_unit.study) %> - <%= render partial: "assets/asset_form_bottom", locals: {show_publications:false, f: f}-%> + <%= render partial: "assets/asset_form_bottom", locals: {show_publications:false, attribution_enable: false, f: f}-%> <%= form_submit_buttons(@observation_unit) %> diff --git a/test/functional/observation_units_controller_test.rb b/test/functional/observation_units_controller_test.rb index 70e5090b87..97fcf82888 100644 --- a/test/functional/observation_units_controller_test.rb +++ b/test/functional/observation_units_controller_test.rb @@ -96,7 +96,9 @@ def rdf_test_object strain: 'updated strain' } } - }} + }, + tag_list:'fish, soup', + } assert_redirected_to obs_unit @@ -106,6 +108,7 @@ def rdf_test_object assert_equal emt, obs_unit.extended_metadata.extended_metadata_type assert_equal 'updated name', obs_unit.extended_metadata.get_attribute_value('name') assert_equal 'updated strain', obs_unit.extended_metadata.get_attribute_value('strain') + assert_equal %w[fish soup], obs_unit.tags.sort end test 'new' do @@ -139,6 +142,7 @@ def rdf_test_object } } }, + tag_list:'fish, soup', policy_attributes: { access_type: Policy::VISIBLE, permissions_attributes: {'1' => {contributor_type: 'Person', contributor_id: other_person.id, access_type: Policy::MANAGING} @@ -152,6 +156,7 @@ def rdf_test_object assert_equal emt, obs_unit.extended_metadata.extended_metadata_type assert_equal 'new name', obs_unit.extended_metadata.get_attribute_value('name') assert_equal 'new strain', obs_unit.extended_metadata.get_attribute_value('strain') + assert_equal %w[fish soup], obs_unit.tags.sort assert_equal contributor, obs_unit.contributor assert_equal [project],obs_unit.projects.sort_by(&:id) assert_equal [creator],obs_unit.creators