FEATURE: Add ability to skip sending the PM if there are no results (#286)

This commit is contained in:
Natalie Tay
2024-04-18 21:40:28 +08:00
committed by GitHub
parent d8d7bbb778
commit b9d875cc3e
4 changed files with 17 additions and 4 deletions
@@ -84,5 +84,13 @@ describe "RecurringDataExplorerResultPm" do
"Hi #{another_group.name}, your data explorer report is ready.\n\nQuery Name:\n#{query.name}",
)
end
it "does not send the PM if skip_empty" do
automation.upsert_field!("skip_empty", "boolean", { value: true })
automation.update(last_updated_by_id: admin.id)
expect { automation.trigger! }.to_not change { Post.count }
end
end
end