1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'gitlab:feature_categories:index', :silence_stdout, feature_category: :scalability do
before do
Rake.application.rake_require 'tasks/gitlab/feature_categories'
end
it 'outputs objects by stage group' do
# Sample items that _hopefully_ won't change very often.
expected = {
'controller_actions' => a_hash_including(
'integrations' => a_collection_including(
klass: 'Oauth::JiraDvcs::AuthorizationsController',
action: 'new',
source_location: [
'app/controllers/oauth/jira_dvcs/authorizations_controller.rb',
an_instance_of(Integer)
]
)
),
'api_endpoints' => a_hash_including(
'system_access' => a_collection_including(
klass: 'API::AccessRequests',
action: '/groups/:id/access_requests',
source_location: [
'lib/api/access_requests.rb',
an_instance_of(Integer)
]
)
),
'sidekiq_workers' => a_hash_including(
'source_code_management' => a_collection_including(
klass: 'MergeWorker',
source_location: [
'app/workers/merge_worker.rb',
an_instance_of(Integer)
]
)
),
'database_tables' => a_hash_including(
'continuous_integration' => a_collection_including('ci_pipelines'),
'user_profile' => a_collection_including('users')
)
}
expect(YAML).to receive(:dump).with(a_hash_including(expected))
run_rake_task('gitlab:feature_categories:index')
end
end
|