wip tests 8

This commit is contained in:
Sara Aimée Smiseth 2020-10-08 17:43:14 +02:00
parent 616052d9cc
commit 31923e9a09
2 changed files with 11 additions and 8 deletions

View file

@ -37,9 +37,4 @@ sudo docker-compose down \
&& sleep 1 \
&& ./bats/bats-core/bin/bats tests.bats
#&& sudo docker-compose logs | grep "message to" \
#&& sudo docker-compose logs | grep "type='error'"
# Received[c2s]: <message to='*@localhost' * type='chat'>
# Should be five times in log
sudo docker-compose down

View file

@ -1,8 +1,16 @@
# For tests with pipes see: https://github.com/sstephenson/bats/issues/10
load 'bats/bats-support/load'
load 'bats/bats-assert/load'
@test "TODO write test" {
run false
@test "Should send 5 messages" {
run bash -c "sudo docker-compose logs | grep \"Received\[c2s\]: <message type='chat' to='.*@localhost' id=':.*'>\" | wc -l"
assert_success
assert_output "TODO"
assert_output "5"
}
@test "Should log error for user with wrong password" {
run bash -c "sudo docker-compose logs | grep \"Session closed by remote with error: undefined-condition (user intervention: authentication failed: authentication aborted by user)\""
assert_success
assert_output
}