+
+ test "history-aware" do
+ Tesla.Mock.mock(fn %{method: :get, url: "http://example.com/image.jpg"} ->
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end)
+
+ with_mock HTTP, get: fn _, _, _ -> {:ok, []} end do
+ MRF.filter_one(MediaProxyWarmingPolicy, @message_with_history)
+
+ assert called(HTTP.get(:_, :_, :_))
+ end
+ end
+
+ test "works with Updates" do
+ Tesla.Mock.mock(fn %{method: :get, url: "http://example.com/image.jpg"} ->
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end)
+
+ with_mock HTTP, get: fn _, _, _ -> {:ok, []} end do
+ MRF.filter_one(MediaProxyWarmingPolicy, @message_with_history |> Map.put("type", "Update"))
+
+ assert called(HTTP.get(:_, :_, :_))
+ end
+ end