Skip to content

Commit

Permalink
Add specs for AppSec ActiveRecord instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
y9v committed Nov 27, 2024
1 parent 9e74c2b commit 0ae4b2c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/datadog/appsec/contrib/active_record/multi_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@

active_record_scope.to_a
end

it 'adds an event to processor context if waf status is :match' do
expect(Datadog::AppSec.active_scope.processor_context).to(
receive(:run).and_return(double(status: :match, actions: {}))
)

expect(Datadog::AppSec.active_scope.processor_context.events).to receive(:<<).and_call_original

active_record_scope.to_a
end
end

context 'mysql2 adapter' do
Expand Down

0 comments on commit 0ae4b2c

Please sign in to comment.