Skip to content

Commit

Permalink
Changing configuration key name and default value for tipline submiss…
Browse files Browse the repository at this point in the history
…ion shortcut

Reference: CV2-2326.
  • Loading branch information
caiosba authored Oct 2, 2023
1 parent 721e5c4 commit 2fe41c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/bot/smooch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion config/config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion test/models/bot/smooch_6_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2fe41c1

Please sign in to comment.