Skip to content

Commit 622221e

Browse files
author
Andriy Zavada
committed
admin_api_http: expires field now an rfc3339 timestamp
1 parent fbae6eb commit 622221e

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tests/admin_api_http_tests.erl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,19 @@ security_user_tests(C) ->
458458
assert_req(
459459
C, {<<"SecurityListUsers">>, #{}},
460460
{"200",
461-
fun([_, #{<<"expires">> := V,
461+
fun(UU) when is_list(UU) ->
462+
[#{<<"expires">> := Expires,
462463
<<"created">> := Created,
463-
<<"modified">> := Modified}])
464-
when V == NewExpires,
465-
Created < Modified -> ok;
466-
(_) -> ?assert(false)
464+
<<"modified">> := Modified}] =
465+
lists:filter(fun(#{<<"name">> := A}) -> A == ?USER1 end, UU),
466+
case (calendar:rfc3339_to_system_time(
467+
binary_to_list(Expires), [{unit, millisecond}])
468+
== NewExpires) and
469+
(Created < Modified) of
470+
true -> ok;
471+
false -> ?assert(false)
472+
end;
473+
(_) -> ?assert(false)
467474
end}),
468475

469476
assert_req(

0 commit comments

Comments
 (0)