From 17da6ee3ec499841a82c40295c0032545e558397 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Wed, 15 Jul 2026 14:16:54 +0530 Subject: [PATCH] test(automations): clone strips execution_delay when feature is disabled --- .../v1/accounts/automation_rules_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/controllers/api/v1/accounts/automation_rules_controller_spec.rb b/spec/controllers/api/v1/accounts/automation_rules_controller_spec.rb index d9026be29..d4c99a879 100644 --- a/spec/controllers/api/v1/accounts/automation_rules_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/automation_rules_controller_spec.rb @@ -506,6 +506,16 @@ RSpec.describe 'Api::V1::Accounts::AutomationRulesController', type: :request do expect(response).to have_http_status(:success) expect(account.automation_rules.last.execution_delay).to be_nil end + + it 'strips execution_delay when cloning an existing delayed rule' do + automation_rule = create(:automation_rule, account: account, execution_delay: 240) + + post "/api/v1/accounts/#{account.id}/automation_rules/#{automation_rule.id}/clone", + headers: administrator.create_new_auth_token + + expect(response).to have_http_status(:success) + expect(account.automation_rules.last.execution_delay).to be_nil + end end end end