Skip to content

Commit

Permalink
test for tags and dont show attributions in edit and create forms #1961
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Jul 19, 2024
1 parent 8fd4126 commit ca35a89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/observation_units/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/observation_units/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<%= resource_study_selection('observation_unit[study_id]', @observation_unit.study) %>
</div>

<%= 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) %>
Expand Down
7 changes: 6 additions & 1 deletion test/functional/observation_units_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def rdf_test_object
strain: 'updated strain'
}
}
}}
},
tag_list:'fish, soup',
}

assert_redirected_to obs_unit

Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down

0 comments on commit ca35a89

Please sign in to comment.