Skip to content

Commit 390f286

Browse files
committed
Add test support for Cloudex
1 parent cac9013 commit 390f286

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

config/dev.exs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,13 @@ config :code_corps, CodeCorps.Mailer,
6161

6262
config :code_corps,
6363
postmark_receipt_template: "123"
64+
65+
# If the dev environment has no CLOUDEX_API_KEY set, we want the app to still run,
66+
# with cloudex in test API mode
67+
if System.get_env("CLOUDEX_API_KEY") == nil do
68+
config :cloudex, :cloudinary_api, Cloudex.CloudinaryApi.Test
69+
config :cloudex, api_key: "test_key", secret: "test_secret", cloud_name: "test_cloud_name"
70+
71+
require Logger
72+
Logger.warn("No Cloudex configuration found. Cloudex is runnning in test mode.")
73+
end

config/test.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ config :code_corps, CodeCorps.Mailer,
4949

5050
config :code_corps,
5151
postmark_receipt_template: "123"
52+
53+
config :cloudex, :cloudinary_api, Cloudex.CloudinaryApi.Test
54+
config :cloudex, api_key: "test_key", secret: "test_secret", cloud_name: "test_cloud_name"

0 commit comments

Comments
 (0)