Skip to content

Commit

Permalink
Add test for the visibility of the propagate permissions checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Jun 26, 2024
1 parent 8843ffa commit 4b6080e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/functional/assays_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,25 @@ def check_fixtures_for_authorization_of_sops_and_datafiles_links
end
end

test 'visibility of the propagate permissions button' do
with_config_value(:isa_json_compliance_enabled, true) do
person = FactoryBot.create(:person)
login_as(person)
investigation = FactoryBot.create(:investigation, is_isa_json_compliant: true, contributor: person)
study = FactoryBot.create(:isa_json_compliant_study, investigation: )
assay_stream = FactoryBot.create(:assay_stream, study: , contributor: person, position: 0)
experimental_assay = FactoryBot.create(:assay, contributor: person, study: , assay_stream:, position: 0)

get :manage, params: { id: assay_stream }
assert_response :success
assert_select 'input[type=checkbox][name=propagate_permissions]', count: 1

get :manage, params: { id: experimental_assay }
assert_response :success
assert_select 'input[type=checkbox][name=propagate_permissions]', count: 0
end
end

test 'Should propagate assay stream permissions' do
with_config_value(:isa_json_compliance_enabled, true) do
person = FactoryBot.create(:person)
Expand Down

0 comments on commit 4b6080e

Please sign in to comment.