From 54f471e31bf95c9c942f22246fedebe4bd9f7de5 Mon Sep 17 00:00:00 2001 From: Diego Lendoiro Date: Wed, 8 Aug 2018 11:37:27 +0200 Subject: [PATCH] tests for nginx and php versions --- spec/docker_runtime/runtime_spec.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/docker_runtime/runtime_spec.rb b/spec/docker_runtime/runtime_spec.rb index 2b6d10a..fce90cb 100644 --- a/spec/docker_runtime/runtime_spec.rb +++ b/spec/docker_runtime/runtime_spec.rb @@ -49,7 +49,6 @@ describe 'passbolt_api service' do let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] } let(:uri) { "/healthcheck/status.json" } let(:curl) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}/#{uri}" } - let(:conf_app) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}/conf/app.php" } describe 'php service' do it 'is running supervised' do @@ -114,4 +113,15 @@ describe 'passbolt_api service' do end end + describe 'hide information' do + let(:curl) { "curl -Isk -H 'Host: passbolt.local' https://#{passbolt_host}/" } + it 'hides php version' do + expect(command("#{curl} | grep 'X-Powered-By: PHP'").stdout).to be_empty + end + + it 'hides nginx version' do + expect(command("#{curl} | grep 'Server:'").stdout).to match 'Server: nginx' + end + end + end