Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-03-07 20:59:27 +0400
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-03-07 20:59:27 +0400
commit562de2a438268bbc71537f2102f4ae7848aaa98e (patch)
treee14705f4f5e2095a0b6f6b12be65bf184245149b /spec
parent32f1eaaf0f966ccc45635693679bcc8658e71815 (diff)
parenta7055be1fdecc51afc4e8f0e94267fcd9d9ef0c1 (diff)
Merge branch 'master' into api/system_hooks_adjustments
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/internal_spec.rb77
1 files changed, 49 insertions, 28 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index d63429df1b0..033c3d35aed 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -34,13 +34,7 @@ describe Gitlab::API do
context "git pull" do
it do
- get(
- api("/internal/allowed"),
- ref: 'master',
- key_id: key.id,
- project: project.path_with_namespace,
- action: 'git-upload-pack'
- )
+ pull(key, project)
response.status.should == 200
response.body.should == 'true'
@@ -49,13 +43,7 @@ describe Gitlab::API do
context "git push" do
it do
- get(
- api("/internal/allowed"),
- ref: 'master',
- key_id: key.id,
- project: project.path_with_namespace,
- action: 'git-receive-pack'
- )
+ push(key, project)
response.status.should == 200
response.body.should == 'true'
@@ -70,13 +58,7 @@ describe Gitlab::API do
context "git pull" do
it do
- get(
- api("/internal/allowed"),
- ref: 'master',
- key_id: key.id,
- project: project.path_with_namespace,
- action: 'git-upload-pack'
- )
+ pull(key, project)
response.status.should == 200
response.body.should == 'false'
@@ -85,13 +67,7 @@ describe Gitlab::API do
context "git push" do
it do
- get(
- api("/internal/allowed"),
- ref: 'master',
- key_id: key.id,
- project: project.path_with_namespace,
- action: 'git-receive-pack'
- )
+ push(key, project)
response.status.should == 200
response.body.should == 'false'
@@ -99,5 +75,50 @@ describe Gitlab::API do
end
end
+ context "blocked user" do
+ let(:personal_project) { create(:project, namespace: user.namespace) }
+
+ before do
+ user.block
+ end
+
+ context "git pull" do
+ it do
+ pull(key, personal_project)
+
+ response.status.should == 200
+ response.body.should == 'false'
+ end
+ end
+
+ context "git push" do
+ it do
+ push(key, personal_project)
+
+ response.status.should == 200
+ response.body.should == 'false'
+ end
+ end
+ end
+ end
+
+ def pull(key, project)
+ get(
+ api("/internal/allowed"),
+ ref: 'master',
+ key_id: key.id,
+ project: project.path_with_namespace,
+ action: 'git-upload-pack'
+ )
+ end
+
+ def push(key, project)
+ get(
+ api("/internal/allowed"),
+ ref: 'master',
+ key_id: key.id,
+ project: project.path_with_namespace,
+ action: 'git-receive-pack'
+ )
end
end