Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/development/query_recorder.md')
-rw-r--r--doc/development/query_recorder.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/development/query_recorder.md b/doc/development/query_recorder.md
index 8759bd09538..424c089f88e 100644
--- a/doc/development/query_recorder.md
+++ b/doc/development/query_recorder.md
@@ -18,9 +18,9 @@ This style of test works by counting the number of SQL queries executed by Activ
```ruby
it "avoids N+1 database queries" do
- control_count = ActiveRecord::QueryRecorder.new { visit_some_page }.count
+ control = ActiveRecord::QueryRecorder.new { visit_some_page }
create_list(:issue, 5)
- expect { visit_some_page }.not_to exceed_query_limit(control_count)
+ expect { visit_some_page }.not_to exceed_query_limit(control)
end
```
@@ -37,9 +37,9 @@ You should pass the `skip_cached` variable to `QueryRecorder` and use the `excee
```ruby
it "avoids N+1 database queries", :use_sql_query_cache do
- control_count = ActiveRecord::QueryRecorder.new(skip_cached: false) { visit_some_page }.count
+ control = ActiveRecord::QueryRecorder.new(skip_cached: false) { visit_some_page }
create_list(:issue, 5)
- expect { visit_some_page }.not_to exceed_all_query_limit(control_count)
+ expect { visit_some_page }.not_to exceed_all_query_limit(control)
end
```