summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 18:08:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 18:08:31 +0000
commit92f95ccac81911d1fcc32e999a7f1ce04624a56c (patch)
treead207e86b7858ae93a085fbdc04155f5cd469620 /spec/lib
parent85e494935a8726dc98bb19ffa584488420e5011e (diff)
downloadgitlab-ce-92f95ccac81911d1fcc32e999a7f1ce04624a56c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/pages_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitlab/pages_spec.rb b/spec/lib/gitlab/pages_spec.rb
index aecbc74385e..5889689cb81 100644
--- a/spec/lib/gitlab/pages_spec.rb
+++ b/spec/lib/gitlab/pages_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
describe Gitlab::Pages do
+ using RSpec::Parameterized::TableSyntax
+
let(:pages_secret) { SecureRandom.random_bytes(Gitlab::Pages::SECRET_LENGTH) }
before do
@@ -26,4 +28,24 @@ describe Gitlab::Pages do
expect(described_class.verify_api_request(headers)).to eq([{ "iss" => "gitlab-pages" }, { "alg" => "HS256" }])
end
end
+
+ describe '.access_control_is_forced?' do
+ subject { described_class.access_control_is_forced? }
+
+ where(:access_control_is_enabled, :access_control_is_forced, :result) do
+ false | false | false
+ false | true | false
+ true | false | false
+ true | true | true
+ end
+
+ with_them do
+ before do
+ stub_pages_setting(access_control: access_control_is_enabled)
+ stub_application_setting(force_pages_access_control: access_control_is_forced)
+ end
+
+ it { is_expected.to eq(result) }
+ end
+ end
end