diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/gitlab_access_spec.rb | 2 | ||||
-rw-r--r-- | spec/gitlab_shell_spec.rb | 25 |
2 files changed, 16 insertions, 11 deletions
diff --git a/spec/gitlab_access_spec.rb b/spec/gitlab_access_spec.rb index a4f633d..c9922dd 100644 --- a/spec/gitlab_access_spec.rb +++ b/spec/gitlab_access_spec.rb @@ -8,6 +8,7 @@ describe GitlabAccess do let(:api) do double(GitlabNet).tap do |api| allow(api).to receive(:check_access).and_return(GitAccessStatus.new(true, + HTTPCodes::HTTP_SUCCESS, 'ok', gl_repository: 'project-1', gl_id: 'user-123', @@ -45,6 +46,7 @@ describe GitlabAccess do before do allow(api).to receive(:check_access).and_return(GitAccessStatus.new( false, + HTTPCodes::HTTP_UNAUTHORIZED, 'denied', gl_repository: nil, gl_id: nil, diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb index 22b21fd..24fe151 100644 --- a/spec/gitlab_shell_spec.rb +++ b/spec/gitlab_shell_spec.rb @@ -22,23 +22,26 @@ describe GitlabShell do let(:git_config_options) { ['receive.MaxInputSize=10000'] } - let(:gitaly_check_access) { GitAccessStatus.new( - true, - 'ok', - gl_repository: gl_repository, - gl_id: gl_id, - gl_username: gl_username, - git_config_options: git_config_options, - gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }, - git_protocol: git_protocol - ) - } + let(:gitaly_check_access) do + GitAccessStatus.new( + true, + HTTPCodes::HTTP_SUCCESS, + 'ok', + gl_repository: gl_repository, + gl_id: gl_id, + gl_username: gl_username, + git_config_options: git_config_options, + gitaly: { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }, + git_protocol: git_protocol + ) + end let(:api) do double(GitlabNet).tap do |api| allow(api).to receive(:discover).and_return({ 'name' => 'John Doe', 'username' => 'testuser' }) allow(api).to receive(:check_access).and_return(GitAccessStatus.new( true, + HTTPCodes::HTTP_SUCCESS, 'ok', gl_repository: gl_repository, gl_id: gl_id, |