@@ -39,6 +39,10 @@ defmodule Hexdocs.QueueTest do
39
39
40
40
assert Store . get ( @ bucket , "queuetest/#{ test } /index.html" ) == "contents"
41
41
assert Store . get ( @ bucket , "queuetest/#{ test } /1.0.0/index.html" ) == "contents"
42
+
43
+ # no searchNodes for private packages.
44
+ docs_config = Store . get ( @ bucket , "queuetest/#{ test } /docs_config.js" )
45
+ [ "var versionNodes = " <> _ ] = String . split ( docs_config , [ ";" , "\n " ] , trim: true )
42
46
end
43
47
44
48
test "upload public files" , % { test: test } do
@@ -249,21 +253,26 @@ defmodule Hexdocs.QueueTest do
249
253
assert Store . get ( @ public_bucket , "#{ test } /3.0.0/index.html" ) == "contents"
250
254
assert Store . get ( @ public_bucket , "#{ test } /index.html" ) == "contents"
251
255
252
- assert "var versionNodes = " <> json = Store . get ( @ public_bucket , "#{ test } /docs_config.js" )
253
- json = String . trim_trailing ( json , ";" )
256
+ docs_config = Store . get ( @ public_bucket , "#{ test } /docs_config.js" )
257
+
258
+ [ "var versionNodes = " <> versions_json , "var searchNodes = " <> search_json ] =
259
+ String . split ( docs_config , [ ";" , "\n " ] , trim: true )
254
260
255
- assert Jason . decode! ( json ) == [
261
+ assert Jason . decode! ( versions_json ) == [
256
262
% {
257
263
"url" => "http://localhost/#{ URI . encode ( Atom . to_string ( test ) ) } /3.0.0" ,
258
264
"version" => "v3.0.0" ,
259
265
"latest" => true
260
266
} ,
261
267
% {
262
268
"url" => "http://localhost/#{ URI . encode ( Atom . to_string ( test ) ) } /1.0.0" ,
263
- "version" => "v1.0.0" ,
264
- "latest" => false
269
+ "version" => "v1.0.0"
265
270
}
266
271
]
272
+
273
+ assert Jason . decode! ( search_json ) == [
274
+ % { "name" => "#{ test } " , "version" => "3.0.0" }
275
+ ]
267
276
end
268
277
269
278
test "special packages" do
0 commit comments