acoeur/bin/_commands/create_delete_test.bats
2022-11-05 22:23:24 +01:00

32 lines
812 B
Bash
Executable File

#!/usr/bin/env bats
@test "Create user" {
echo "users" > content/users/create_test.create
[ -e content/users/create_test.create ]
bin/ac_route.sh "$(pwd)/content/users" create_test.create
[ ! -e content/users/create_test.create ]
[ -e content/users/create_test/_index.md ]
}
@test "Update property" {
echo "title: Simple edit" > content/users/create_test/_index.prop
bin/ac_route.sh "$(pwd)/content/users/create_test" _index.prop
grep -o "^title: Simple edit" content/users/create_test/_index.md
}
@test "Delete user" {
echo "hop" > content/users/create_test.delete
[ -e content/users/create_test.delete ]
bin/ac_route.sh "$(pwd)/content/users" create_test.delete
[ ! -e content/users/create_test.delete ]
[ ! -e content/users/create_test/_index.md ]
[ ! -e content/users/create_test ]
}