summaryrefslogtreecommitdiff
path: root/spec/requests/api/branches_spec.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-09-19 16:11:23 +0200
committerRémy Coutable <remy@rymai.me>2017-09-19 16:26:20 +0200
commit3914af2f7129fc03ccddda0957bde43d5a26b0eb (patch)
tree8a7128be234c64f34fcc58623296b88c5c0e5a10 /spec/requests/api/branches_spec.rb
parent6ab74da9c687a13c1692f8ccb05af72be3a73695 (diff)
downloadgitlab-ce-3914af2f7129fc03ccddda0957bde43d5a26b0eb.tar.gz
Use set in some API specsrc/use-set-in-api-specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/requests/api/branches_spec.rb')
-rw-r--r--spec/requests/api/branches_spec.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb
index cc794fad3a7..16b12446ed4 100644
--- a/spec/requests/api/branches_spec.rb
+++ b/spec/requests/api/branches_spec.rb
@@ -1,9 +1,9 @@
require 'spec_helper'
describe API::Branches do
- let(:user) { create(:user) }
- let(:guest) { create(:user).tap { |u| project.add_guest(u) } }
+ set(:user) { create(:user) }
let(:project) { create(:project, :repository, creator: user, path: 'my.project') }
+ let(:guest) { create(:user).tap { |u| project.add_guest(u) } }
let(:branch_name) { 'feature' }
let(:branch_sha) { '0b4bc9a49b562e85de7cc9e834518ea6828729b9' }
let(:branch_with_dot) { project.repository.find_branch('ends-with.json') }
@@ -40,7 +40,9 @@ describe API::Branches do
end
context 'when unauthenticated', 'and project is public' do
- let(:project) { create(:project, :public, :repository) }
+ before do
+ project.update(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
+ end
it_behaves_like 'repository branches'
end
@@ -118,7 +120,9 @@ describe API::Branches do
end
context 'when unauthenticated', 'and project is public' do
- let(:project) { create(:project, :public, :repository) }
+ before do
+ project.update(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
+ end
it_behaves_like 'repository branch'
end