diff options
Diffstat (limited to 'spec/support/shared_examples/features/cascading_settings_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/cascading_settings_shared_examples.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/support/shared_examples/features/cascading_settings_shared_examples.rb b/spec/support/shared_examples/features/cascading_settings_shared_examples.rb index 29ef3da9a85..395f4fc54e0 100644 --- a/spec/support/shared_examples/features/cascading_settings_shared_examples.rb +++ b/spec/support/shared_examples/features/cascading_settings_shared_examples.rb @@ -13,10 +13,22 @@ RSpec.shared_examples 'a cascading setting' do click_save_button end - it 'disables setting in subgroups' do - visit subgroup_path + shared_examples 'subgroup settings are disabled' do + it 'disables setting in subgroups' do + visit subgroup_path + + expect(find("#{setting_field_selector}[disabled]")).to be_checked + end + end + + include_examples 'subgroup settings are disabled' + + context 'when use_traversal_ids_for_ancestors is disabled' do + before do + stub_feature_flags(use_traversal_ids_for_ancestors: false) + end - expect(find("#{setting_field_selector}[disabled]")).to be_checked + include_examples 'subgroup settings are disabled' end it 'does not show enforcement checkbox in subgroups' do |