| 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # Copyright (c) 2016 Tom O'Donnell |
| 4 | # MIT Licensed; see the LICENSE file in this repository. |
| 5 | # |
| 6 | |
| 7 | test_description="Test API add command" |
| 8 | |
| 9 | . lib/test-lib.sh |
| 10 | |
| 11 | test_init_ipfs |
| 12 | |
| 13 | # Verify that the API add command returns size |
| 14 | |
| 15 | test_launch_ipfs_daemon |
| 16 | test_expect_success "API Add response includes size field" ' |
| 17 | echo "hi" | curl -s -F file=@- "http://localhost:$API_PORT/api/v0/add" | grep "\"Size\": *\"11\"" |
| 18 | ' |
| 19 | test_kill_ipfs_daemon |
| 20 | |
| 21 | test_done |