Skip to content

Commit

Permalink
CV2-5621: add missing tests 1/2
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy committed Nov 5, 2024
1 parent f72b0a8 commit e04e1ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/lib/check_config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,10 @@ class CheckConfigTest < ActiveSupport::TestCase
ENV.delete('test_other_env_key')
end

test "should handle json value " do
stub_configs({ 'test_json_key' => '{"lang":{"en":"default.html"}}', 'test_invalid_json_key' => 'invalid_json_value' }) do
assert_equal 'default.html', CheckConfig.get('test_json_key', nil, :json)
assert_equal 'invalid_json_value', CheckConfig.get('test_invalid_json_key', nil, :json)
end
end
end
2 changes: 2 additions & 0 deletions test/models/bot/smooch_7_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ def teardown
sleep 2 # Wait for ElasticSearch to index content

assert_equal [pm1.id, pm2.id, pm3.id], Bot::Smooch.search_for_similar_published_fact_checks('text', 'Foo Bar', [t.id]).to_a.map(&:id)
# Calling wiht skip_cache true
assert_equal [pm1.id, pm2.id, pm3.id], Bot::Smooch.search_for_similar_published_fact_checks('text', 'Foo Bar', [t.id], nil, nil, nil, true).to_a.map(&:id)
end

test "should store media" do
Expand Down

0 comments on commit e04e1ca

Please sign in to comment.