Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ENV stubbing in zendesk_sender_spec
Upgrading to version 3 of the dotenv-rails gem causes tests in zendesk_sender_spec to fail with the error `FrozenError: can't modify frozen Hash: [...]`. This is because the latest version of dotenv-rails introduces an Autorestore feature which automatically restores the state of ENV between rspec tests. In zendesk_sender_spec we stub the value of ENV['ENV'] using `stub_const`, which also resets between tests and leads to a conflict: bkeepers/dotenv#482. This is resolved by replacing the use of `stub_const` with the `Dotenv.modify` method (also introduced in v3), which makes dotenv-rails fully responsible for the stubbing of environment variables and avoids conflict.
- Loading branch information