Skip to content

Commit

Permalink
Created a failing spec
Browse files Browse the repository at this point in the history
While investigating an issue of missing data we started investigating the implementation of sending events while inside Rails transactions.

This commit reproduces a bug that may be contributing to some of our data issues.
The existing spec assets that no events are send if the transaction is rolled back, however the spec was passing due to `allowlist_fields` not being set.
After setting the `allowlist_fields` we see a test failure as the `SendEvents` job is called.
  • Loading branch information
dcyoung-dev authored and asatwal committed Dec 13, 2024
1 parent 17c4845 commit f34c9af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/dfe/analytics/entities_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
end

describe 'rollback behavior' do
let(:allowlist_fields) { %w[email_address first_name] }
it 'does not send create event if the transaction is rolled back' do
ActiveRecord::Base.transaction do
Candidate.create(id: 123)
Expand Down

0 comments on commit f34c9af

Please sign in to comment.