summaryrefslogtreecommitdiff
path: root/spec/policies/global_policy_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/policies/global_policy_spec.rb')
-rw-r--r--spec/policies/global_policy_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/policies/global_policy_spec.rb b/spec/policies/global_policy_spec.rb
index 9e995366c17..e88619b9527 100644
--- a/spec/policies/global_policy_spec.rb
+++ b/spec/policies/global_policy_spec.rb
@@ -245,6 +245,14 @@ RSpec.describe GlobalPolicy do
end
it { is_expected.not_to be_allowed(:access_api) }
+
+ context 'when user is using ldap' do
+ before do
+ allow(current_user).to receive(:ldap_user?).and_return(true)
+ end
+
+ it { is_expected.to be_allowed(:access_api) }
+ end
end
context 'when terms are enforced' do
@@ -433,6 +441,14 @@ RSpec.describe GlobalPolicy do
end
it { is_expected.not_to be_allowed(:access_git) }
+
+ context 'when user is using ldap' do
+ before do
+ allow(current_user).to receive(:ldap_user?).and_return(true)
+ end
+
+ it { is_expected.to be_allowed(:access_git) }
+ end
end
end
@@ -517,6 +533,14 @@ RSpec.describe GlobalPolicy do
end
it { is_expected.not_to be_allowed(:use_slash_commands) }
+
+ context 'when user is using ldap' do
+ before do
+ allow(current_user).to receive(:ldap_user?).and_return(true)
+ end
+
+ it { is_expected.to be_allowed(:use_slash_commands) }
+ end
end
end