0.4.0
Added current_scale
functionality
From now on, instead of using populate
block and (re)creating records on each execution of block being tested, the user can add parameters to the block depending on current_scale
. This method will return the current scale factor.
RSpec usage:
context "N+1", :n_plus_one do
specify do
expect { get :index, params: { limit: current_scale } }.to perform_constant_number_of_queries
end
end
Minitest usage:
def test_no_n_plus_one
assert_perform_constant_number_of_queries do
get :index, params: { limit: current_scale }
end
end