diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-03-28 12:33:45 +1100 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-04-04 14:20:11 +1100 |
commit | 6b7a9b7498a4c91ca9c7324a0e31d8a142fddeef (patch) | |
tree | 0a81e50117474a2773d49b2f912b71c4a4496fb4 /spec | |
parent | 74ace2a445a44a13bd22c1907b8ec55b1772d403 (diff) | |
download | gitlab-ce-6b7a9b7498a4c91ca9c7324a0e31d8a142fddeef.tar.gz |
Allow console messages be sent to gitlab-shell9217-warn-on-git-fetch-over-ssh-if-the-secondary-is-lagging-the-primary
Currently a no-op for CE
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/internal_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index 537194b8e11..6640ce2b07e 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -498,6 +498,40 @@ describe API::Internal do end end + context "console message" do + before do + project.add_developer(user) + end + + context "git pull" do + context "with no console message" do + it "has the correct payload" do + pull(key, project) + + expect(response).to have_gitlab_http_status(200) + expect(json_response['gl_console_messages']).to eq([]) + end + end + + context "with a console message" do + let(:console_messages) { ['message for the console'] } + + it "has the correct payload" do + expect_next_instance_of(Gitlab::GitAccess) do |access| + expect(access).to receive(:check_for_console_messages) + .with('git-upload-pack') + .and_return(console_messages) + end + + pull(key, project) + + expect(response).to have_gitlab_http_status(200) + expect(json_response['gl_console_messages']).to eq(console_messages) + end + end + end + end + context "blocked user" do let(:personal_project) { create(:project, namespace: user.namespace) } |