Fossil SCM

Cover simple case of /json/user/save to create a new user. Consider covering various other ways that endpoint can be used, as well as CLI vs GET and POST. Current case is CLI based. This case completes coverage of the basic features provided by all documented JSON endpoints.

rberteig 2016-01-30 01:45 rberteig-json-test
Commit 1571e4c2781a5a88497242a0dc502c904c21a7e6
1 file changed +11 -2
+11 -2
--- test/json.test
+++ test/json.test
@@ -424,11 +424,11 @@
424424
425425
426426
# json tag cancel NAME CHECKIN
427427
fossil_json tag add cancel alpha
428428
test_json_envelope_ok json-tag-cancel-env
429
-# BUG? Doc says no payload.
429
+# DOCBUG? Doc says no payload.
430430
test_json_payload json-tag-cancel {name value propagate raw appliedTo} {}
431431
432432
# json tag find NAME
433433
fossil_json tag find alpha
434434
test_json_envelope_ok json-tag-find-env
@@ -516,11 +516,20 @@
516516
test_dict_keys json-user-list-$i $u {uid name capabilities info timestamp} {}
517517
incr i
518518
}
519519
520520
# json user save
521
-test TODO-json-user-save false knownBug
521
+fossil json user save --uid -1 --name U2 --password Utwo
522
+test_json_envelope_ok json-user-save-env
523
+# DOCBUG? Doc says payload is "same as /json/user/get" but actual
524
+# result was an array of one user similar to /json/user/list.
525
+set i 0
526
+foreach u [dict get $JR payload] {
527
+ test_dict_keys json-user-save-$i $u {uid name capabilities info timestamp} {}
528
+ incr i
529
+}
530
+#test_json_payload json-user-save {uid name capabilities info timestamp} {}
522531
523532
#### WIKI
524533
525534
# wiki list
526535
fossil_json wiki list
527536
--- test/json.test
+++ test/json.test
@@ -424,11 +424,11 @@
424
425
426 # json tag cancel NAME CHECKIN
427 fossil_json tag add cancel alpha
428 test_json_envelope_ok json-tag-cancel-env
429 # BUG? Doc says no payload.
430 test_json_payload json-tag-cancel {name value propagate raw appliedTo} {}
431
432 # json tag find NAME
433 fossil_json tag find alpha
434 test_json_envelope_ok json-tag-find-env
@@ -516,11 +516,20 @@
516 test_dict_keys json-user-list-$i $u {uid name capabilities info timestamp} {}
517 incr i
518 }
519
520 # json user save
521 test TODO-json-user-save false knownBug
 
 
 
 
 
 
 
 
 
522
523 #### WIKI
524
525 # wiki list
526 fossil_json wiki list
527
--- test/json.test
+++ test/json.test
@@ -424,11 +424,11 @@
424
425
426 # json tag cancel NAME CHECKIN
427 fossil_json tag add cancel alpha
428 test_json_envelope_ok json-tag-cancel-env
429 # DOCBUG? Doc says no payload.
430 test_json_payload json-tag-cancel {name value propagate raw appliedTo} {}
431
432 # json tag find NAME
433 fossil_json tag find alpha
434 test_json_envelope_ok json-tag-find-env
@@ -516,11 +516,20 @@
516 test_dict_keys json-user-list-$i $u {uid name capabilities info timestamp} {}
517 incr i
518 }
519
520 # json user save
521 fossil json user save --uid -1 --name U2 --password Utwo
522 test_json_envelope_ok json-user-save-env
523 # DOCBUG? Doc says payload is "same as /json/user/get" but actual
524 # result was an array of one user similar to /json/user/list.
525 set i 0
526 foreach u [dict get $JR payload] {
527 test_dict_keys json-user-save-$i $u {uid name capabilities info timestamp} {}
528 incr i
529 }
530 #test_json_payload json-user-save {uid name capabilities info timestamp} {}
531
532 #### WIKI
533
534 # wiki list
535 fossil_json wiki list
536

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button