Skip to content
Snippets Groups Projects
Unverified Commit 5e6cbf63 authored by Jay Montal's avatar Jay Montal Committed by Allen Cook
Browse files

Update adherence_report_ui ff scope

- Updates the adherence_report_ui to also pass in an object (group)
on the check so that the page renders properly if ff is enabled
for a group

Changelog: changed
EE: true
parent bd9d17ff
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -10,4 +10,4 @@
pipeline_configuration_full_path_enabled: can?(current_user, :admin_compliance_pipeline_configuration, @group),
base_path: group_security_compliance_dashboard_path(@group),
pipeline_configuration_enabled: @group.licensed_feature_available?(:compliance_pipeline_configuration).to_s,
adherence_report_ui_enabled: Feature.enabled?(:adherence_report_ui).to_s } }
adherence_report_ui_enabled: Feature.enabled?(:adherence_report_ui, @group).to_s } }
Loading
Loading
@@ -11,7 +11,6 @@
before do
allow(view).to receive(:current_user).and_return(user)
assign(:group, group)
render
end
 
it 'renders with the correct data attributes', :aggregate_failures do
Loading
Loading
@@ -25,6 +24,43 @@
expect(rendered).to have_selector("[data-root-ancestor-path='#{group.root_ancestor.full_path}']")
expect(rendered).to have_selector("[data-base-path='#{group_security_compliance_dashboard_path(group)}']")
expect(rendered).to have_selector("[data-pipeline-configuration-enabled='false']")
expect(rendered).to have_selector("[data-adherence-report-ui-enabled='true']")
end
context 'for `adherence-report-ui-enabled` selector' do
before do
Feature.disable(:adherence_report_ui)
end
context 'when feature `adherence_report_ui` is not enabled' do
it 'renders with the correct selector value' do
render
expect(rendered).to have_selector("[data-adherence-report-ui-enabled='false']")
end
end
context 'when feature `adherence_report_ui` is enabled for a group' do
before do
Feature.enable(:adherence_report_ui, group)
end
it 'renders with the correct selector value' do
render
expect(rendered).to have_selector("[data-adherence-report-ui-enabled='true']")
end
end
context 'when feature `adherence_report_ui` is globally enabled' do
before do
Feature.enable(:adherence_report_ui)
end
it 'renders with the correct selector value' do
render
expect(rendered).to have_selector("[data-adherence-report-ui-enabled='true']")
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment