summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-05-19 19:52:45 +0000
committerFatih Acet <acetfatih@gmail.com>2017-05-19 19:52:45 +0000
commit5460153c9f1a0b1679e4f31f1d588cb77857b714 (patch)
treebbee0c9665f835a7834995374b15ab32d86eded9 /spec
parentdb4bbbabcafa78cfa0176fefac1b4c1dd33d098f (diff)
parentb3cf3d046b8a319c0dbca7cb9aeaea027c080e6f (diff)
downloadgitlab-ce-5460153c9f1a0b1679e4f31f1d588cb77857b714.tar.gz
Merge branch '32536-mr-widget-performance-improvements' into 'master'
Load improvements related to MR widget See merge request !11518
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects/merge_requests_controller_spec.rb12
-rw-r--r--spec/fixtures/api/schemas/entities/merge_request.json1
-rw-r--r--spec/fixtures/api/schemas/entities/merge_request_basic.json3
-rw-r--r--spec/javascripts/vue_mr_widget/mr_widget_options_spec.js2
-rw-r--r--spec/routing/project_routing_spec.rb5
5 files changed, 14 insertions, 9 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb
index 0b3492a8fed..f0dc6df15ee 100644
--- a/spec/controllers/projects/merge_requests_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests_controller_spec.rb
@@ -119,6 +119,18 @@ describe Projects::MergeRequestsController do
expect(response).to match_response_schema('entities/merge_request')
end
end
+
+ context 'number of queries' do
+ it 'verifies number of queries' do
+ # pre-create objects
+ merge_request
+
+ recorded = ActiveRecord::QueryRecorder.new { go(format: :json) }
+
+ expect(recorded.count).to be_within(1).of(51)
+ expect(recorded.cached_count).to eq(0)
+ end
+ end
end
describe "as diff" do
diff --git a/spec/fixtures/api/schemas/entities/merge_request.json b/spec/fixtures/api/schemas/entities/merge_request.json
index e5df3e7b6d1..4afbb87453e 100644
--- a/spec/fixtures/api/schemas/entities/merge_request.json
+++ b/spec/fixtures/api/schemas/entities/merge_request.json
@@ -3,7 +3,6 @@
"properties" : {
"id": { "type": "integer" },
"iid": { "type": "integer" },
- "assignee_id": { "type": ["integer", "null"] },
"author_id": { "type": "integer" },
"description": { "type": ["string", "null"] },
"lock_version": { "type": ["string", "null"] },
diff --git a/spec/fixtures/api/schemas/entities/merge_request_basic.json b/spec/fixtures/api/schemas/entities/merge_request_basic.json
index ea6364b878c..6b14188582a 100644
--- a/spec/fixtures/api/schemas/entities/merge_request_basic.json
+++ b/spec/fixtures/api/schemas/entities/merge_request_basic.json
@@ -8,7 +8,8 @@
"total_time_spent": { "type": "integer" },
"human_time_estimate": { "type": ["string", "null"] },
"human_total_time_spent": { "type": ["string", "null"] },
- "merge_error": { "type": ["string", "null"] }
+ "merge_error": { "type": ["string", "null"] },
+ "assignee_id": { "type": ["integer", "null"] }
},
"additionalProperties": false
}
diff --git a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
index 22ee7dcf0e7..bdc18243a15 100644
--- a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
+++ b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
@@ -227,13 +227,11 @@ describe('mrWidgetOptions', () => {
describe('handleMounted', () => {
it('should call required methods to do the initial kick-off', () => {
- spyOn(vm, 'checkStatus');
spyOn(vm, 'initDeploymentsPolling');
spyOn(vm, 'setFavicon');
vm.handleMounted();
- expect(vm.checkStatus).toHaveBeenCalled();
expect(vm.setFavicon).toHaveBeenCalled();
expect(vm.initDeploymentsPolling).toHaveBeenCalled();
});
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index 50e96d56191..d5400bbaaf1 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -243,7 +243,6 @@ describe 'project routing' do
# diffs_namespace_project_merge_request GET /:namespace_id/:project_id/merge_requests/:id/diffs(.:format) projects/merge_requests#diffs
# commits_namespace_project_merge_request GET /:namespace_id/:project_id/merge_requests/:id/commits(.:format) projects/merge_requests#commits
# merge_namespace_project_merge_request POST /:namespace_id/:project_id/merge_requests/:id/merge(.:format) projects/merge_requests#merge
- # merge_check_namespace_project_merge_request GET /:namespace_id/:project_id/merge_requests/:id/merge_check(.:format) projects/merge_requests#merge_check
# ci_status_namespace_project_merge_request GET /:namespace_id/:project_id/merge_requests/:id/ci_status(.:format) projects/merge_requests#ci_status
# toggle_subscription_namespace_project_merge_request POST /:namespace_id/:project_id/merge_requests/:id/toggle_subscription(.:format) projects/merge_requests#toggle_subscription
# branch_from_namespace_project_merge_requests GET /:namespace_id/:project_id/merge_requests/branch_from(.:format) projects/merge_requests#branch_from
@@ -272,10 +271,6 @@ describe 'project routing' do
)
end
- it 'to #merge_check' do
- expect(get('/gitlab/gitlabhq/merge_requests/1/merge_check')).to route_to('projects/merge_requests#merge_check', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
it 'to #branch_from' do
expect(get('/gitlab/gitlabhq/merge_requests/branch_from')).to route_to('projects/merge_requests#branch_from', namespace_id: 'gitlab', project_id: 'gitlabhq')
end