Skip to content

Commit

Permalink
Add test coverage for replicator user_ctx parser
Browse files Browse the repository at this point in the history
This adds a test to cover the case when a replication doc contains a
user_ctx, and subsequently executes `get_json_value/3`.

See: #4343
  • Loading branch information
jaydoane committed Jan 4, 2023
1 parent 8e47e71 commit f8d489f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/couch_replicator/src/couch_replicator_parse.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f8d489f

Please sign in to comment.