From 2fb862ccc6687273ada997743392d9dab7b31d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 18 Nov 2016 12:02:45 +0100 Subject: Rely on Gitlab::Shell public API, not reading internal files it may use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It ensures we rely on `Gitlab::Shell`'s public API and not on its internal. Since `Gitlab::Shell` is caching the value of its token, the only way to get the correct token is to call `Gitlab::Shell.secret_token`, not to read the `Gitlab.config.gitlab_shell.secret_file` file! Signed-off-by: Rémy Coutable --- spec/requests/api/internal_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index 8f1a1f9e827..03796f20e36 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -5,7 +5,7 @@ describe API::API, api: true do let(:user) { create(:user) } let(:key) { create(:key, user: user) } let(:project) { create(:project) } - let(:secret_token) { File.read Gitlab.config.gitlab_shell.secret_file } + let(:secret_token) { Gitlab::Shell.secret_token } describe "GET /internal/check", no_db: true do it do -- cgit v1.2.1