diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-06 09:07:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-06 09:07:42 +0000 |
commit | 669c24d9276db9a73bbcea40aeab98273aae9e5e (patch) | |
tree | 9548cfccd841b4aae3703cdd1b5bf5c167d5a8dc /spec/controllers | |
parent | 13076511c60f62ce0f8baba22ca9b94755a7d3cb (diff) | |
download | gitlab-ce-669c24d9276db9a73bbcea40aeab98273aae9e5e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/git_http_controller_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/controllers/projects/git_http_controller_spec.rb b/spec/controllers/projects/git_http_controller_spec.rb index b7568346cdc..a898e1afd8f 100644 --- a/spec/controllers/projects/git_http_controller_spec.rb +++ b/spec/controllers/projects/git_http_controller_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' describe Projects::GitHttpController do + include GitHttpHelpers + let_it_be(:project) { create(:project, :public, :repository) } let(:project_params) do { @@ -31,6 +33,28 @@ describe Projects::GitHttpController do expect(response.status).to eq(401) end + context 'with authorized user' do + let(:user) { project.owner } + + before do + request.headers.merge! auth_env(user.username, user.password, nil) + end + + it 'returns 200' do + get :info_refs, params: params + + expect(response.status).to eq(200) + end + + it 'updates the user activity' do + expect_next_instance_of(Users::ActivityService) do |activity_service| + expect(activity_service).to receive(:execute) + end + + get :info_refs, params: params + end + end + context 'with exceptions' do before do allow(controller).to receive(:verify_workhorse_api!).and_return(true) |