summaryrefslogtreecommitdiff
path: root/spec/requests/lfs_http_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/lfs_http_spec.rb')
-rw-r--r--spec/requests/lfs_http_spec.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/requests/lfs_http_spec.rb b/spec/requests/lfs_http_spec.rb
index fda8b2ecec6..02eb4262690 100644
--- a/spec/requests/lfs_http_spec.rb
+++ b/spec/requests/lfs_http_spec.rb
@@ -105,6 +105,7 @@ RSpec.describe 'Git LFS API and storage' do
context 'when deploy key is authorized' do
let_it_be(:key) { create(:deploy_key) }
+
let(:authorization) { authorize_deploy_key }
before do
@@ -125,7 +126,7 @@ RSpec.describe 'Git LFS API and storage' do
it_behaves_like 'LFS http 200 blob response'
context 'when user password is expired' do
- let_it_be(:user) { create(:user, password_expires_at: 1.minute.ago)}
+ let_it_be(:user) { create(:user, password_expires_at: 1.minute.ago, password_automatically_set: true)}
it_behaves_like 'LFS http 401 response'
end
@@ -343,7 +344,8 @@ RSpec.describe 'Git LFS API and storage' do
end
context 'when user password is expired' do
- let_it_be(:user) { create(:user, password_expires_at: 1.minute.ago)}
+ let_it_be(:user) { create(:user, password_expires_at: 1.minute.ago, password_automatically_set: true)}
+
let(:role) { :reporter}
it_behaves_like 'LFS http 401 response'
@@ -351,6 +353,7 @@ RSpec.describe 'Git LFS API and storage' do
context 'when user is blocked' do
let_it_be(:user) { create(:user, :blocked)}
+
let(:role) { :reporter}
it_behaves_like 'LFS http 401 response'
@@ -405,6 +408,7 @@ RSpec.describe 'Git LFS API and storage' do
context 'administrator', :enable_admin_mode do
let_it_be(:user) { create(:admin) }
+
let(:build) { create(:ci_build, :running, pipeline: pipeline, user: user) }
it_behaves_like 'can download LFS only from own projects', renew_authorization: true
@@ -458,6 +462,7 @@ RSpec.describe 'Git LFS API and storage' do
describe 'upload' do
let_it_be(:project) { create(:project, :public) }
+
let(:body) { upload_body(sample_object) }
shared_examples 'pushes new LFS objects' do |renew_authorization:|
@@ -569,7 +574,7 @@ RSpec.describe 'Git LFS API and storage' do
let(:pipeline) { create(:ci_empty_pipeline, project: other_project) }
# I'm not sure what this tests that is different from the previous test
- it_behaves_like 'LFS http 404 response'
+ it_behaves_like 'LFS http 403 response'
end
end
@@ -953,7 +958,7 @@ RSpec.describe 'Git LFS API and storage' do
it_behaves_like 'LFS http 200 workhorse response'
context 'when user password is expired' do
- let_it_be(:user) { create(:user, password_expires_at: 1.minute.ago)}
+ let_it_be(:user) { create(:user, password_expires_at: 1.minute.ago, password_automatically_set: true) }
it_behaves_like 'LFS http 401 response'
end
@@ -984,6 +989,7 @@ RSpec.describe 'Git LFS API and storage' do
describe 'to a forked project' do
let_it_be(:upstream_project) { create(:project, :public) }
let_it_be(:project_owner) { create(:user) }
+
let(:project) { fork_project(upstream_project, project_owner) }
describe 'when user is authenticated' do
@@ -1043,7 +1049,7 @@ RSpec.describe 'Git LFS API and storage' do
let(:pipeline) { create(:ci_empty_pipeline, project: other_project) }
# I'm not sure what this tests that is different from the previous test
- it_behaves_like 'LFS http 404 response'
+ it_behaves_like 'LFS http 403 response'
end
end