Commit ec2ed1fe authored by Alexander Turinske's avatar Alexander Turinske

Update helpers to be more concise

- ensure helper matches project helper
parent aa89bd58
...@@ -11,8 +11,8 @@ module EE ...@@ -11,8 +11,8 @@ module EE
return unless namespace return unless namespace
{ {
assigned_policy_project: 'null', assigned_policy_project: nil.to_json,
disable_scan_policy_update: false, disable_scan_policy_update: false.to_s,
create_agent_help_path: help_page_url('user/clusters/agent/install/index'), create_agent_help_path: help_page_url('user/clusters/agent/install/index'),
policy: policy&.to_json, policy: policy&.to_json,
policy_editor_empty_state_svg_path: image_path('illustrations/monitoring/unable_to_connect.svg'), policy_editor_empty_state_svg_path: image_path('illustrations/monitoring/unable_to_connect.svg'),
......
- add_to_breadcrumbs s_("SecurityOrchestration|Policies"), group_security_policies_path(@group) - add_to_breadcrumbs s_("SecurityOrchestration|Policies"), group_security_policies_path(@group)
- breadcrumb_title s_("SecurityOrchestration|New policy") - breadcrumb_title s_("SecurityOrchestration|New policy")
- page_title s_("SecurityOrchestration|Policy editor") - page_title s_("SecurityOrchestration|Policy editor")
- data = security_orchestration_policy_data(@group)
#js-group-policy-builder-app{ data: data } #js-group-policy-builder-app{ data: security_orchestration_policy_data(@group) }
...@@ -10,8 +10,8 @@ RSpec.describe EE::SecurityOrchestrationHelper do ...@@ -10,8 +10,8 @@ RSpec.describe EE::SecurityOrchestrationHelper do
let(:owner) { namespace.first_owner } let(:owner) { namespace.first_owner }
let(:base_data) do let(:base_data) do
{ {
assigned_policy_project: "null", assigned_policy_project: nil.to_json,
disable_scan_policy_update: false, disable_scan_policy_update: false.to_s,
create_agent_help_path: kind_of(String), create_agent_help_path: kind_of(String),
policy: policy&.to_json, policy: policy&.to_json,
policy_editor_empty_state_svg_path: kind_of(String), policy_editor_empty_state_svg_path: kind_of(String),
...@@ -40,12 +40,7 @@ RSpec.describe EE::SecurityOrchestrationHelper do ...@@ -40,12 +40,7 @@ RSpec.describe EE::SecurityOrchestrationHelper do
let(:policy_type) { 'scan_execution_policy' } let(:policy_type) { 'scan_execution_policy' }
let(:policy) do let(:policy) do
Gitlab::Kubernetes::CiliumNetworkPolicy.new( build(:scan_execution_policy, name: 'Run DAST in every pipeline')
name: 'policy',
namespace: 'another',
selector: { matchLabels: { role: 'db' } },
ingress: [{ from: [{ namespaceSelector: { matchLabels: { group: 'mygroup' } } }] }]
)
end end
it { is_expected.to match(base_data) } it { is_expected.to match(base_data) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment