Commit 5645f93c authored by Alexander Turinske's avatar Alexander Turinske

Add additional properties to policy_details helper

- for the `:security_orchestration_policies_configuration`
  feature flag, we started using the
  orchestration_policy_data helper method for policies,
  but used the same frontend
- some properties were added for the
  orchestration_policy_data helper that were not added to the
  policy_details helper
- update test

Changelog: fixed
EE: true
parent b67689b5
......@@ -31,11 +31,14 @@ module PolicyHelper
{
assigned_policy_project: assigned_policy_project(project).to_json,
default_environment_id: project.default_environment&.id || -1,
disable_scan_execution_update: disable_scan_execution_update.to_s,
network_policies_endpoint: project_security_network_policies_path(project),
configure_agent_help_path: help_page_url('user/clusters/agent/repository.html'),
create_agent_help_path: help_page_url('user/clusters/agent/index.md', anchor: 'create-an-agent-record-in-gitlab'),
environments_endpoint: project_environments_path(project),
network_documentation_path: help_page_path('user/application_security/policies/index'),
no_environment_svg_path: image_path('illustrations/monitoring/unable_to_connect.svg'),
project_path: project.full_path,
project_id: project.id,
threat_monitoring_path: project_threat_monitoring_path(project)
......
......@@ -18,11 +18,14 @@ RSpec.describe PolicyHelper do
let(:base_data) do
{
assigned_policy_project: "null",
default_environment_id: -1,
disable_scan_execution_update: "false",
network_policies_endpoint: kind_of(String),
configure_agent_help_path: kind_of(String),
create_agent_help_path: kind_of(String),
environments_endpoint: kind_of(String),
network_documentation_path: kind_of(String),
no_environment_svg_path: kind_of(String),
project_path: project.full_path,
project_id: project.id,
threat_monitoring_path: kind_of(String)
......@@ -51,6 +54,7 @@ RSpec.describe PolicyHelper do
it 'returns expected policy data' do
expect(subject).to match(
base_data.merge(
default_environment_id: project.default_environment.id,
policy: policy.to_json,
environment_id: environment.id
)
......
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