Skip to content

Commit 9178213

Browse files
authored
Merge pull request #695 from code-corps/cloudex-test-support
Add test support for Cloudex
2 parents 31c5867 + ea8524a commit 9178213

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

config/dev.exs

+9
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,12 @@ 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+
IO.puts("NOTE: No Cloudex configuration found. Cloudex is runnning in test mode.")
72+
end

config/test.exs

+3
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)