1 # frozen_string_literal: true
3 # Fail tests on N+1 queries, apart from those with any of the files listed
4 # in test/prosopite_todo.yml in their call stack. That list should only
5 # ever shrink. Each of these is scanned separately:
7 # * requests, whether made by ActionDispatch::IntegrationTest subclasses
8 # (which includes the tests in test/controllers as well as
9 # test/integration) or by the browser in system tests
10 # * jobs performed by any test (see test/test_helper.rb)
12 # Test setup, such as creating records with factories, isn't scanned.
14 require "prosopite/middleware/rack"
15 Rails.application.config.middleware.use(Prosopite::Middleware::Rack)
17 Prosopite.raise = true
18 Prosopite.allow_stack_paths = YAML.load_file(Rails.root.join("test/prosopite_todo.yml")).map do |path|
19 # Match "/app/models/way.rb:123" but not "/app/models/old_way.rb:123"