n_plus_one_control
n_plus_one_control copied to clipboard
RSpec and Minitest matchers to prevent N+1 queries problem
## What did you do? ```ruby class Admin::Api::ApplicationPlanLimitsControllerTest < ActionDispatch::IntegrationTest include NPlusOneControl::MinitestHelper attr_reader :service, :app_plan def setup @provider = FactoryBot.create(:provider_account) @token = FactoryBot.create(:access_token, owner: @provider.admin_users.first!, scopes: %w[account_management]).value host! @provider.admin_domain @service...
fixes #56 Not doing the whole checklist to see if feature is accepted as it is now. ## Checklist - [x] I've added tests for this change - [ ]...
I would like to be able to do ```ruby test 'my operation performs only a single database query' do assert_number_of_queries(1) do get :index end end ``` My particular use case...
## What did you do? I have a following scenario ``` context "N+1", :n_plus_one do it "n+1" do audit_type_2 = create(:audit_type, account: org) audit_type_3 = create(:audit_type, account: org) audit_type_4 =...
First of all thank you for this amazing Gem, it's a clean and simple solution to avoid n+1 regressions. Could you explain why memoizing the action in rspec is not...