From 5ecf228b09beb3ad1f06c5bfaf6338ff85a2a9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 26 Jun 2017 16:46:10 +0200 Subject: [PATCH] Add spec to check image attachment destroy method on budget investment model. --- spec/models/budget/investment_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index 44cfd4a55..5f0a519d9 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -99,6 +99,11 @@ describe Budget::Investment do end + it "image destroy should remove image from file storage" do + image_url = investment_with_image.image.url + + expect{ investment_with_image.image.destroy }.to change{ investment_with_image.image.url }.from(image_url).to("/images/original/missing.png") + end end it "sanitizes description" do