summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-03-23 15:48:28 +0000
committerNick Thomas <nick@gitlab.com>2018-03-23 15:48:28 +0000
commit457a99c612acf59ec9cc4d0793c53465f914e696 (patch)
treeca474ece3e4db339d225d9789298ee78051848eb /spec/spec_helper.rb
parent79dd74db14ffdac34fa2eff0aa26387b29a16cb5 (diff)
parent9d45951fcaeda4f01a2e4be2480d980a3e7cd37e (diff)
downloadgitlab-ce-457a99c612acf59ec9cc4d0793c53465f914e696.tar.gz
Merge branch 'pages_force_https' into 'master'
HTTPS only Pages Closes #28857 See merge request gitlab-org/gitlab-ce!16273
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 9f6f0204a16..5051cd34564 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -197,6 +197,22 @@ RSpec.configure do |config|
Ability.allowed?(*args)
end
end
+
+ config.before(:each, :http_pages_enabled) do |_|
+ allow(Gitlab.config.pages).to receive(:external_http).and_return(['1.1.1.1:80'])
+ end
+
+ config.before(:each, :https_pages_enabled) do |_|
+ allow(Gitlab.config.pages).to receive(:external_https).and_return(['1.1.1.1:443'])
+ end
+
+ config.before(:each, :http_pages_disabled) do |_|
+ allow(Gitlab.config.pages).to receive(:external_http).and_return(false)
+ end
+
+ config.before(:each, :https_pages_disabled) do |_|
+ allow(Gitlab.config.pages).to receive(:external_https).and_return(false)
+ end
end
# add simpler way to match asset paths containing digest strings