From 4b6080ee7403a89302c130f2307cbd0063bd603d Mon Sep 17 00:00:00 2001 From: Kevin De Pelseneer Date: Wed, 26 Jun 2024 16:50:40 +0200 Subject: [PATCH] Add test for the visibility of the propagate permissions checkbox --- test/functional/assays_controller_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/functional/assays_controller_test.rb b/test/functional/assays_controller_test.rb index 971367c3f0..55be9db459 100644 --- a/test/functional/assays_controller_test.rb +++ b/test/functional/assays_controller_test.rb @@ -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)