Commit graph

4 commits

Author SHA1 Message Date
Sean McGivern
5883ce95ef current_application_settings belongs on Gitlab::CurrentSettings
The initializers including this were doing so at the top level, so every object
loaded after them had a `current_application_settings` method. However, if
someone had rack-attack enabled (which was loaded before these initializers), it
would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't
have that method.

To fix this:

1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need
   `Object.new.current_application_settings` to work.
2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it
   like that in several places.
3. Change the initializers to use that new form.
2017-08-31 13:38:33 +01:00
Rémy Coutable
8f13c1ebd9
Use a slightly cleaner approach to stub ENV
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-28 11:18:09 +02:00
Stan Hu
1a47bd37a1 Reset the state of StubENV's @env_already_stubbed after each spec run
In certain combination of tests, @env_already_stubbed could be set
to `true` even though it never ran for that specific test.
2017-06-26 08:13:46 -07:00
Adam Niedzielski
a8177e03e5 Introduce "stub_env" test helper for safely stubbing environment variables 2017-01-09 18:19:48 +01:00