Skip to content

Consider mocking out Flodesk::Client in specs #2322

@mikej

Description

@mikej

Follow up to #2321

Currently the Flodesk client is intentionally enabled when running in the test environment as a result of setting the Flodesk API to "test" in the initializer:

key = Rails.env.test? ? 'test' : ENV['FLODESK_KEY']

This means all requests to Flodesk that are triggered during tests will be failing due to the invalid API key.

Requests will be triggered whenever we fabricate a student or a coach (as a result of a after_create callback on Subscription).

We can avoid the unnecessary requests, and potentially improve test performance by mocking out Flodesk::Client

Metadata

Metadata

Assignees

Labels

rubyPull requests that update Ruby codetests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions