summaryrefslogtreecommitdiff
path: root/spec/requests/lfs_http_spec.rb
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-12-22 19:18:28 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2017-12-22 19:18:28 +1100
commit27c95364b52f4e93054c45211010aeb22e40a2b2 (patch)
treeb817a1aa7bc4416bfc4cc2e51b2856d36479faf8 /spec/requests/lfs_http_spec.rb
parent36f4710301926bb853b35d9b14a60e03b42def34 (diff)
downloadgitlab-ce-27c95364b52f4e93054c45211010aeb22e40a2b2.tar.gz
Replace '.team << [user, role]' with 'add_role(user)' in specs36782-replace-team-user-role-with-add_role-user-in-specs
Diffstat (limited to 'spec/requests/lfs_http_spec.rb')
-rw-r--r--spec/requests/lfs_http_spec.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/requests/lfs_http_spec.rb b/spec/requests/lfs_http_spec.rb
index c597623bc4d..5e59bb0d585 100644
--- a/spec/requests/lfs_http_spec.rb
+++ b/spec/requests/lfs_http_spec.rb
@@ -63,7 +63,7 @@ describe 'Git LFS API and storage' do
context 'with LFS disabled globally' do
before do
- project.team << [user, :master]
+ project.add_master(user)
allow(Gitlab.config.lfs).to receive(:enabled).and_return(false)
end
@@ -106,7 +106,7 @@ describe 'Git LFS API and storage' do
context 'with LFS enabled globally' do
before do
- project.team << [user, :master]
+ project.add_master(user)
enable_lfs
end
@@ -234,7 +234,7 @@ describe 'Git LFS API and storage' do
context 'and does have project access' do
let(:update_permissions) do
- project.team << [user, :master]
+ project.add_master(user)
project.lfs_objects << lfs_object
end
@@ -259,7 +259,7 @@ describe 'Git LFS API and storage' do
context 'when user allowed' do
let(:update_permissions) do
- project.team << [user, :master]
+ project.add_master(user)
project.lfs_objects << lfs_object
end
@@ -295,7 +295,7 @@ describe 'Git LFS API and storage' do
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:update_permissions) do
- project.team << [user, :reporter]
+ project.add_reporter(user)
project.lfs_objects << lfs_object
end
@@ -517,7 +517,7 @@ describe 'Git LFS API and storage' do
let(:authorization) { authorize_user }
let(:update_user_permissions) do
- project.team << [user, role]
+ project.add_role(user, role)
end
it_behaves_like 'an authorized requests' do
@@ -553,7 +553,7 @@ describe 'Git LFS API and storage' do
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:update_user_permissions) do
- project.team << [user, :reporter]
+ project.add_reporter(user)
end
it_behaves_like 'an authorized requests'
@@ -673,7 +673,7 @@ describe 'Git LFS API and storage' do
let(:authorization) { authorize_user }
let(:update_user_permissions) do
- project.team << [user, :developer]
+ project.add_developer(user)
end
context 'when pushing an lfs object that already exists' do
@@ -795,7 +795,7 @@ describe 'Git LFS API and storage' do
context 'when user is not authenticated' do
context 'when user has push access' do
let(:update_user_permissions) do
- project.team << [user, :master]
+ project.add_master(user)
end
it 'responds with status 401' do
@@ -840,7 +840,7 @@ describe 'Git LFS API and storage' do
before do
allow(Gitlab::Database).to receive(:read_only?) { true }
- project.team << [user, :master]
+ project.add_master(user)
enable_lfs
end
@@ -935,7 +935,7 @@ describe 'Git LFS API and storage' do
describe 'when user has push access to the project' do
before do
- project.team << [user, :developer]
+ project.add_developer(user)
end
context 'and the request bypassed workhorse' do
@@ -993,7 +993,7 @@ describe 'Git LFS API and storage' do
describe 'and user does not have push access' do
before do
- project.team << [user, :reporter]
+ project.add_reporter(user)
end
it_behaves_like 'forbidden'
@@ -1010,7 +1010,7 @@ describe 'Git LFS API and storage' do
let(:build) { create(:ci_build, :running, pipeline: pipeline, user: user) }
before do
- project.team << [user, :developer]
+ project.add_developer(user)
put_authorize
end
@@ -1062,7 +1062,7 @@ describe 'Git LFS API and storage' do
describe 'when user has push access to the project' do
before do
- project.team << [user, :developer]
+ project.add_developer(user)
end
context 'and request is sent by gitlab-workhorse to authorize the request' do
@@ -1149,7 +1149,7 @@ describe 'Git LFS API and storage' do
let(:authorization) { authorize_user }
before do
- second_project.team << [user, :master]
+ second_project.add_master(user)
upstream_project.lfs_objects << lfs_object
end