From f0198d6b83a5782e47e9beb6787e4e5e1e1867aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janko=20Marohni=C4=87?= Date: Sat, 19 Feb 2022 18:55:24 +0100 Subject: [PATCH] Show testing requests with cached attachment data Closes #557 --- doc/testing.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/testing.md b/doc/testing.md index 1a6249ff..0bb03472 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -201,6 +201,15 @@ app.post "/photos", multipart: { ``` +If you want to test requests with cached attachment data, you can do so as +follows: + +```rb +cached_file = Shrine.upload(file, :cache) + +post "/photos", photo: { image: cached_file.to_json } +``` + ## Background jobs If you're using background jobs with Shrine, you probably want to make them