Skip to content

Add test support for Cloudex #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,12 @@ config :code_corps, CodeCorps.Mailer,

config :code_corps,
postmark_receipt_template: "123"

# If the dev environment has no CLOUDEX_API_KEY set, we want the app to still run,
# with cloudex in test API mode
if System.get_env("CLOUDEX_API_KEY") == nil do
config :cloudex, :cloudinary_api, Cloudex.CloudinaryApi.Test
config :cloudex, api_key: "test_key", secret: "test_secret", cloud_name: "test_cloud_name"

IO.puts("NOTE: No Cloudex configuration found. Cloudex is runnning in test mode.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to do this as a warn with a yellow log color.

Also, is this test_key, etc an actual Cloudinary value, or just something we're using?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a random value. We need to provide a value, any value, or Cloudex raises an error on startup.

end
3 changes: 3 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ config :code_corps, CodeCorps.Mailer,

config :code_corps,
postmark_receipt_template: "123"

config :cloudex, :cloudinary_api, Cloudex.CloudinaryApi.Test
config :cloudex, api_key: "test_key", secret: "test_secret", cloud_name: "test_cloud_name"