summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-12-20 15:05:57 +0100
committerRémy Coutable <remy@rymai.me>2016-12-20 16:11:10 +0100
commit0349e83aa74b42c3f564fd1bc34104300a41ddf5 (patch)
tree23052c64868d7cfac8d7061e8f751a9c6b75a2f2 /spec/support
parent5652da8bb4ea26acd35a241683e242439fefdd33 (diff)
downloadgitlab-ce-4269-public-files-api.tar.gz
Improve specs for Files API4269-public-files-api
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/api/repositories_shared_context.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/api/repositories_shared_context.rb b/spec/support/api/repositories_shared_context.rb
new file mode 100644
index 00000000000..ea38fe4f5b8
--- /dev/null
+++ b/spec/support/api/repositories_shared_context.rb
@@ -0,0 +1,10 @@
+shared_context 'disabled repository' do
+ before do
+ project.project_feature.update_attributes!(
+ repository_access_level: ProjectFeature::DISABLED,
+ merge_requests_access_level: ProjectFeature::DISABLED,
+ builds_access_level: ProjectFeature::DISABLED
+ )
+ expect(project.feature_available?(:repository, current_user)).to be false
+ end
+end