Skip to content

Commit

Permalink
Add a test for the block incoming method
Browse files Browse the repository at this point in the history
  • Loading branch information
armiiller committed May 1, 2024
1 parent 7a4c3ed commit c72e349
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/models/pager_tree/integrations/hetrix_tools/v3_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,14 @@ class HetrixTools::V3Test < ActiveSupport::TestCase
actual.thirdparty_id = nil
assert_equal true_alert.to_json, actual.to_json
end

test "blocking_incoming" do
assert @integration.option_authentication_token.blank?
assert_not @integration.adapter_should_block_incoming?(OpenStruct.new({headers: {"Authorization" => ""}}))

@integration.option_authentication_token = "abc123456"
assert @integration.adapter_should_block_incoming?(OpenStruct.new({headers: {"Authorization" => ""}}))
assert_not @integration.adapter_should_block_incoming?(OpenStruct.new({headers: {"Authorization" => "Bearer abc123456"}}))
end
end
end

0 comments on commit c72e349

Please sign in to comment.