@@ -99,6 +99,13 @@ fixture(get, <<?TEST_REPO_URL, "/docs/ecto-1.0.0.tar.gz">>, _, _) ->
9999 {ok , Docs } = hex_tarball :create_docs ([]),
100100 {ok , {200 , Headers , Docs }};
101101
102+ fixture (get , <<? TEST_REPO_URL , " /installs/hex-1.x.csv" >>, _ , _ ) ->
103+ Headers = #{
104+ <<" etag" >> => <<" \" dummy\" " >>
105+ },
106+ CSV = <<" 1.0.0,abc123,1.13.0\n 1.1.0,def456,1.14.0\n " >>,
107+ {ok , {200 , Headers , CSV }};
108+
102109fixture (get , <<? TEST_REPO_URL , " /public_key" >>, _ , _ ) ->
103110 Headers = #{
104111 <<" etag" >> => <<" \" dummy\" " >>
@@ -233,6 +240,15 @@ fixture(delete, <<?TEST_API_URL, "/keys/", Name/binary>>, #{<<"authorization">>
233240 },
234241 {ok , {200 , api_headers (), term_to_binary (Payload )}};
235242
243+ fixture (post , <<? TEST_API_URL , " /short_url" >>, _ , {_ , Body }) ->
244+ DecodedBody = binary_to_term (Body ),
245+ #{<<" url" >> := URL } = DecodedBody ,
246+ ShortURL = <<" https://hex.pm/l/" , (integer_to_binary (erlang :phash2 (URL )))/binary >>,
247+ Payload = #{
248+ <<" url" >> => ShortURL
249+ },
250+ {ok , {201 , api_headers (), term_to_binary (Payload )}};
251+
236252% % Other
237253
238254fixture (Method , URI , _ , _ ) ->
0 commit comments