From 60a3758d381b9b398206796ffa886f648bf9c012 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Tue, 24 Aug 2021 16:37:19 +0200 Subject: [PATCH] Fixes #2544 - Can't remove auto assignment timeout. --- .../_application_controller/form.coffee | 2 +- spec/system/manage/groups_spec.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller/form.coffee b/app/assets/javascripts/app/controllers/_application_controller/form.coffee index 01ee6f760..39ca618d5 100644 --- a/app/assets/javascripts/app/controllers/_application_controller/form.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller/form.coffee @@ -510,7 +510,7 @@ class App.ControllerForm extends App.Controller value = false if item.type is 'integer' if value is '' - value = undefined + value = null else value = parseInt(value) if param[item.name] isnt undefined diff --git a/spec/system/manage/groups_spec.rb b/spec/system/manage/groups_spec.rb index c2d2116bb..42963cd65 100644 --- a/spec/system/manage/groups_spec.rb +++ b/spec/system/manage/groups_spec.rb @@ -7,4 +7,22 @@ RSpec.describe 'Manage > Groups', type: :system do context 'ajax pagination' do include_examples 'pagination', model: :group, klass: Group, path: 'manage/groups' end + + context "Issue 2544 - Can't remove auto assignment timeout" do + before do + visit '/#manage/groups' + end + + it 'is possible to reset the assignment timeout of a group' do + find('td', text: 'Users').click + fill_in 'Assignment Timeout', with: '30' + find('button', text: 'Submit').click + expect(Group.find_by(name: 'Users').assignment_timeout).to eq(30) + + find('td', text: 'Users').click + fill_in 'Assignment Timeout', with: '' + find('button', text: 'Submit').click + expect(Group.find_by(name: 'Users').assignment_timeout).to be nil + end + end end