From 2fe41c109dc815c6fcc690069918068cdaea7449 Mon Sep 17 00:00:00 2001 From: Caio Almeida <117518+caiosba@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:55:14 -0300 Subject: [PATCH] Changing configuration key name and default value for tipline submission shortcut Reference: CV2-2326. --- app/models/bot/smooch.rb | 2 +- config/config.yml.example | 2 +- test/models/bot/smooch_6_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/bot/smooch.rb b/app/models/bot/smooch.rb index 803e631e91..a2e50b2206 100644 --- a/app/models/bot/smooch.rb +++ b/app/models/bot/smooch.rb @@ -539,7 +539,7 @@ def self.process_menu_option_value(value, option, message, language, workflow, a end def self.is_a_shortcut_for_submission?(state, message) - self.is_v2? && (state == 'main' || state == 'waiting_for_message') && (!message['mediaUrl'].blank? || ::Bot::Alegre.get_number_of_words(message['text'].to_s) > CheckConfig.get('min_number_of_words_for_tipline_shortcut', 3, :integer)) + self.is_v2? && (state == 'main' || state == 'waiting_for_message') && (!message['mediaUrl'].blank? || ::Bot::Alegre.get_number_of_words(message['text'].to_s) > CheckConfig.get('min_number_of_words_for_tipline_submit_shortcut', 10, :integer)) end def self.process_menu_option(message, state, app_id) diff --git a/config/config.yml.example b/config/config.yml.example index 2c6ff6cb39..ebbd6d49c9 100644 --- a/config/config.yml.example +++ b/config/config.yml.example @@ -44,7 +44,7 @@ development: &default image_cluster_similarity_threshold: 0.9 text_cluster_similarity_threshold: 0.9 similarity_media_file_url_host: '' - min_number_of_words_for_tipline_shortcut: 3 + min_number_of_words_for_tipline_submit_shortcut: 10 # Localization # diff --git a/test/models/bot/smooch_6_test.rb b/test/models/bot/smooch_6_test.rb index ff608d617c..77d18a14bb 100644 --- a/test/models/bot/smooch_6_test.rb +++ b/test/models/bot/smooch_6_test.rb @@ -784,7 +784,7 @@ def send_message_outside_24_hours_window(template, pm = nil) nlu.disable! reload_tipline_settings send_message 'Can I subscribe to the newsletter?' - assert_state 'ask_if_ready' + assert_state 'main' # Delete two keywords, so expect two calls to Alegre Bot::Alegre.expects(:request_api).with{ |x, y, _z| x == 'delete' && y == '/text/similarity/' }.twice