33 lines
1.3 KiB
PowerShell
33 lines
1.3 KiB
PowerShell
$projectRoot = Split-Path -Parent $PSScriptRoot
|
|
$deployScriptPath = Join-Path $projectRoot 'scripts\Deploy-Perspektivwerk.ps1'
|
|
|
|
Describe 'Perspektivwerk deployment' {
|
|
It 'provides a deployment script for the static page' {
|
|
(Test-Path -LiteralPath $deployScriptPath) | Should Be $true
|
|
}
|
|
|
|
It 'uploads the static page and its nested booking assets with one scp invocation' {
|
|
$script = Get-Content -LiteralPath $deployScriptPath -Raw
|
|
|
|
$script | Should Match 'public[\\/]perspektivwerk'
|
|
$script | Should Not Match 'public[\\/]booking'
|
|
$script | Should Match 'boogie:/home/boogie/html/perspektivwerk/'
|
|
([regex]::Matches($script, '& scp')).Count | Should Be 1
|
|
$script | Should Not Match '& rsync'
|
|
}
|
|
|
|
It 'repairs read and traversal permissions with a separate SSH invocation' {
|
|
$script = Get-Content -LiteralPath $deployScriptPath -Raw
|
|
|
|
([regex]::Matches($script, '& ssh')).Count | Should Be 1
|
|
$script | Should Match 'chmod -R a\+rX /home/boogie/html/perspektivwerk'
|
|
}
|
|
|
|
It 'prints the complete static-page target directory' {
|
|
$script = Get-Content -LiteralPath $deployScriptPath -Raw
|
|
|
|
$script | Should Match 'Zielverzeichnisse auf dem Server'
|
|
$script | Should Match 'boogie:/home/boogie/html/perspektivwerk/'
|
|
}
|
|
}
|