diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-15 03:14:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-15 03:14:10 +0300 |
commit | 119c999cf1f1bb51d4324e3c4847435347eb32cf (patch) | |
tree | 83f92f606877455177bb57c7d2ad31704d10027b /spec/lib/sidebars/projects | |
parent | 5594a6badf033359b84c2e9822f145c66b0dce8f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/sidebars/projects')
-rw-r--r-- | spec/lib/sidebars/projects/menus/monitor_menu_spec.rb | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb b/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb index ba5137e2b92..bd0904b9db2 100644 --- a/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb +++ b/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb @@ -12,11 +12,28 @@ RSpec.describe Sidebars::Projects::Menus::MonitorMenu do subject { described_class.new(context) } describe '#render?' do - context 'when operations feature is disabled' do - it 'returns false' do - project.project_feature.update!(operations_access_level: Featurable::DISABLED) + using RSpec::Parameterized::TableSyntax + let(:enabled) { Featurable::PRIVATE } + let(:disabled) { Featurable::DISABLED } + + where(:flag_enabled, :operations_access_level, :monitor_level, :render) do + true | ref(:disabled) | ref(:enabled) | true + true | ref(:disabled) | ref(:disabled) | false + true | ref(:enabled) | ref(:enabled) | true + true | ref(:enabled) | ref(:disabled) | false + false | ref(:disabled) | ref(:enabled) | false + false | ref(:disabled) | ref(:disabled) | false + false | ref(:enabled) | ref(:enabled) | true + false | ref(:enabled) | ref(:disabled) | true + end + + with_them do + it 'renders when expected to' do + stub_feature_flags(split_operations_visibility_permissions: flag_enabled) + project.project_feature.update!(operations_access_level: operations_access_level) + project.project_feature.update!(monitor_access_level: monitor_level) - expect(subject.render?).to be false + expect(subject.render?).to be render end end |