diff --git a/spec/acceptance/comptoir_spec.rb b/spec/acceptance/comptoir_spec.rb index 67bb21ea47837bb213b27d8a00bbc85bcce435bf..6e4b5ca1a0ca7bb1d39c3b72a9c3c2bc676c9de0 100644 --- a/spec/acceptance/comptoir_spec.rb +++ b/spec/acceptance/comptoir_spec.rb @@ -1,10 +1,15 @@ require 'spec_helper_acceptance' sys_rootpath = '/var/www/comptoir' -download_checksum_initial = 'f33363b96fc330b9298d3477f90ee1aaa09eb06605901b72af3d472c054cf223' # 3.0.0.alpha.4 +################################################################################################################## +version_intitial = '3.0.0.alpha.4' +download_checksum_initial = 'f33363b96fc330b9298d3477f90ee1aaa09eb06605901b72af3d472c054cf223' download_url_initial = 'https://gitlab.adullact.net/Comptoir/comptoir-du-libre/-/package_files/1056/download' -download_checksum_upgrade = '94b1030201af12ef2d3efbc263b21bc514c6c6fbb1043486cad00849538328fc' # 3.0.0.alpha.5 +################################################################################################################## +version_upgrade = '3.0.0.alpha.5' +download_checksum_upgrade = '94b1030201af12ef2d3efbc263b21bc514c6c6fbb1043486cad00849538328fc' download_url_upgrade = 'https://gitlab.adullact.net/Comptoir/comptoir-du-libre/-/package_files/1057/download' +################################################################################################################## config_path = '/etc/comptoir' archive_rootdir = 'comptoir' var_path = '/var/comptoir' @@ -35,16 +40,22 @@ describe 'comptoir' do it { is_expected.to be_linked_to "#{sys_rootpath}/#{download_checksum_initial}/#{archive_rootdir}" } end - describe command('curl http://127.0.0.1') do - its(:stdout) { is_expected.to match %r{HOME PAGE} } # Fixme + describe command('curl -i http://127.0.0.1') do + its(:stdout) { is_expected.to match %r{HTTP/1.1 308 Permanent Redirect} } + its(:stdout) { is_expected.to match %r{Location: /fr/} } + its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} } end - # describe command('curl http://127.0.0.1') do - # its(:stdout) { is_expected.to match %r{v0.10.0} } - # end + describe command('curl -i http://127.0.0.1/fr/') do + its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} } + its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} } + its(:stdout) { is_expected.to match %r{<title>Comptoir-du-Libre} } + end describe command('curl --head http://127.0.0.1/health-check') do - its(:stdout) { is_expected.to match %r{x-comptoir-name-fixme-database-status: DB_CONNECTION_SUCCESSFUL} } # Fixme + its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} } + its(:stdout) { is_expected.to match %r{x-comptoir-database-status: DB_CONNECTION_SUCCESSFUL} } + its(:stdout) { is_expected.to match %r{x-comptoir-version: #{version_intitial}} } end describe file(config_path.to_s) do @@ -152,16 +163,22 @@ describe 'comptoir' do apply_manifest(pp, catch_changes: true) end - describe command('curl http://127.0.0.1') do - its(:stdout) { is_expected.to match %r{HOME PAGE} } # Fixme + describe command('curl -i http://127.0.0.1') do + its(:stdout) { is_expected.to match %r{HTTP/1.1 308 Permanent Redirect} } + its(:stdout) { is_expected.to match %r{Location: /fr/} } + its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} } end - # describe command('curl http://127.0.0.1') do - # its(:stdout) { is_expected.to match %r{v0.10.0} } - # end + describe command('curl -i http://127.0.0.1/fr/') do + its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} } + its(:stdout) { is_expected.to match %r{x-comptoir-webapp: 1} } + its(:stdout) { is_expected.to match %r{<title>Comptoir-du-Libre} } + end describe command('curl --head http://127.0.0.1/health-check') do - its(:stdout) { is_expected.to match %r{x-comptoir-name-fixme-database-status: DB_CONNECTION_SUCCESSFUL} } # Fixme + its(:stdout) { is_expected.to match %r{HTTP/1.1 200 OK} } + its(:stdout) { is_expected.to match %r{x-comptoir-database-status: DB_CONNECTION_SUCCESSFUL} } + its(:stdout) { is_expected.to match %r{x-comptoir-version: #{version_upgrade}} } end describe file("#{sys_rootpath}/#{download_checksum_initial}") do