diff options
author | Roger Rüttimann <roger.ruettimann@gmail.com> | 2018-08-30 15:53:06 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-08-30 15:53:06 +0300 |
commit | 93b9bfd93a841b7f86e6aeab3f9c5e9ede3a4503 (patch) | |
tree | 8bfec898a33d9b0b1693e73ce27a61db54881a66 /spec/helpers | |
parent | 3113fb848001fdea3a039295002d7752b0feebbb (diff) |
Allow whitelisting for "external collaborator by default" setting
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/users_helper_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index b079802cb81..34d9115a1f6 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -42,6 +42,30 @@ describe UsersHelper do end end + describe '#user_internal_regex_data' do + using RSpec::Parameterized::TableSyntax + + where(:user_default_external, :user_default_internal_regex, :result) do + false | nil | { user_internal_regex_pattern: nil, user_internal_regex_options: nil } + false | '' | { user_internal_regex_pattern: nil, user_internal_regex_options: nil } + false | 'mockRegexPattern' | { user_internal_regex_pattern: nil, user_internal_regex_options: nil } + true | nil | { user_internal_regex_pattern: nil, user_internal_regex_options: nil } + true | '' | { user_internal_regex_pattern: nil, user_internal_regex_options: nil } + true | 'mockRegexPattern' | { user_internal_regex_pattern: 'mockRegexPattern', user_internal_regex_options: 'gi' } + end + + with_them do + before do + stub_application_setting(user_default_external: user_default_external) + stub_application_setting(user_default_internal_regex: user_default_internal_regex) + end + + subject { helper.user_internal_regex_data } + + it { is_expected.to eq(result) } + end + end + describe '#current_user_menu_items' do subject(:items) { helper.current_user_menu_items } |