Skip to content

Commit

Permalink
Add failing spec to show problem
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Aug 27, 2024
1 parent bf6a13f commit e58b257
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/flipper/adapters/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@
flipper.preload([:foo])
end

it 'should not poision wrapping transactions' do
flipper = Flipper.new(subject)

actor = Struct.new(:flipper_id).new('flipper-id-123')
flipper.enable_actor(:foo, actor)

ActiveRecord::Base.transaction do
flipper.enable_actor(:foo, actor)
expect(Flipper::Adapters::ActiveRecord::Gate.count).to eq 1
end
end

context "ActiveRecord connection_pool" do
before do
ActiveRecord::Base.connection_handler.clear_active_connections!
Expand Down

0 comments on commit e58b257

Please sign in to comment.