diff options
author | Jay Doane <jaydoane@apache.org> | 2023-01-04 10:06:33 -0800 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2023-01-05 15:20:32 +0100 |
commit | 181b809dd536ba874942f2ba1c44c672f25d258c (patch) | |
tree | fbec114e6a369bafd9a1aacbebfe25115bb861d1 | |
parent | 008033ab50981e33317b8acb4944173da0d2d508 (diff) | |
download | couchdb-181b809dd536ba874942f2ba1c44c672f25d258c.tar.gz |
Add test coverage for replicator user_ctx parser
This adds a test to cover the case when a replication doc contains a
user_ctx, and subsequently executes `get_json_value/3`.
See: https://github.com/apache/couchdb/pull/4343
-rw-r--r-- | src/couch_replicator/src/couch_replicator_parse.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/couch_replicator/src/couch_replicator_parse.erl b/src/couch_replicator/src/couch_replicator_parse.erl index 8cad4d9a3..e4c0c0211 100644 --- a/src/couch_replicator/src/couch_replicator_parse.erl +++ b/src/couch_replicator/src/couch_replicator_parse.erl @@ -583,6 +583,13 @@ check_convert_options_fail_test() -> convert_options([{<<"query_params">>, 42}]) ). +rep_user_ctx_test() -> + RepDoc = {[{<<"user_ctx">>, {[]}}]}, + ?assertEqual( + #user_ctx{name = null, roles = [], handler = undefined}, + rep_user_ctx(RepDoc) + ). + local_replication_endpoint_error_test_() -> { foreach, |