Skip to content

Commit

Permalink
fix(config): add V3 API url config in test config
Browse files Browse the repository at this point in the history
This way the defined API url can be used for organizing test files without being relient on what is configured in the envrc.template
  • Loading branch information
KaylaBrady committed Jan 23, 2024
1 parent 0fffb31 commit 13c8fc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import Config
# any compile-time configuration in here, as it won't be applied.
# The block below contains prod specific runtime configuration.

# mbta_v3_api configuration in disguise
config :mobile_app_backend,
base_url: System.get_env("API_URL"),
api_key: System.get_env("API_KEY")

if config_env() != :test do
# mbta_v3_api configuration in disguise
config :mobile_app_backend,
base_url: System.get_env("API_URL"),
api_key: System.get_env("API_KEY")

config :mobile_app_backend, MobileAppBackend.Search.Algolia,
app_id: System.get_env("ALGOLIA_APP_ID"),
search_key: System.get_env("ALGOLIA_SEARCH_KEY"),
Expand Down
3 changes: 3 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ config :logger, level: :warning
# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime

config :mobile_app_backend,
base_url: "https://api-dev.mbtace.com/"

config :mobile_app_backend, MobileAppBackend.Search.Algolia,
app_id: "fake_app",
search_key: "fake_key",
Expand Down

0 comments on commit 13c8fc0

Please sign in to comment.