Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled deleting auto_batch_clusters from edit script forms #3100

Merged
merged 2 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dashboard/app/helpers/scripts_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ def script_form_double
end

def script_removable_field?(id)
!['script_auto_scripts'].include?(id.to_s)
['script_auto_scripts', 'script_auto_batch_clusters'].exclude?(id.to_s)
end
end
14 changes: 14 additions & 0 deletions apps/dashboard/test/helpers/scripts_helper_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'test_helper'

class ScriptsHelperTest < ActionView::TestCase
include ScriptsHelper

test 'script_removable_field? should return false for expected fields' do
assert_equal true, script_removable_field?('any_field')

non_removable_fields = ['script_auto_scripts', 'script_auto_batch_clusters']
non_removable_fields.each do |field|
assert_equal false, script_removable_field?(field)
end
end
end