acoeur/bin/_commands/create_delete_test.bats

33 lines
813 B
Plaintext
Raw Normal View History

2022-10-26 23:12:29 +02:00
#!/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 ]
}