BigW Consortium Gitlab

Commit abe39684 by Robert Speicher

Use `empty_project` where possible in spec/features/security

parent 56ae036e
...@@ -4,7 +4,7 @@ describe 'Internal Group access' do ...@@ -4,7 +4,7 @@ describe 'Internal Group access' do
include AccessMatchers include AccessMatchers
let(:group) { create(:group, :internal) } let(:group) { create(:group, :internal) }
let(:project) { create(:project, :internal, group: group) } let(:project) { create(:empty_project, :internal, group: group) }
let(:project_guest) do let(:project_guest) do
create(:user) do |user| create(:user) do |user|
project.add_guest(user) project.add_guest(user)
...@@ -49,6 +49,7 @@ describe 'Internal Group access' do ...@@ -49,6 +49,7 @@ describe 'Internal Group access' do
end end
describe 'GET /groups/:path/merge_requests' do describe 'GET /groups/:path/merge_requests' do
let(:project) { create(:project, :internal, :repository, group: group) }
subject { merge_requests_group_path(group) } subject { merge_requests_group_path(group) }
it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:admin) }
......
...@@ -4,7 +4,7 @@ describe 'Private Group access' do ...@@ -4,7 +4,7 @@ describe 'Private Group access' do
include AccessMatchers include AccessMatchers
let(:group) { create(:group, :private) } let(:group) { create(:group, :private) }
let(:project) { create(:project, :private, group: group) } let(:project) { create(:empty_project, :private, group: group) }
let(:project_guest) do let(:project_guest) do
create(:user) do |user| create(:user) do |user|
project.add_guest(user) project.add_guest(user)
...@@ -49,6 +49,7 @@ describe 'Private Group access' do ...@@ -49,6 +49,7 @@ describe 'Private Group access' do
end end
describe 'GET /groups/:path/merge_requests' do describe 'GET /groups/:path/merge_requests' do
let(:project) { create(:project, :private, :repository, group: group) }
subject { merge_requests_group_path(group) } subject { merge_requests_group_path(group) }
it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:admin) }
......
...@@ -4,7 +4,7 @@ describe 'Public Group access' do ...@@ -4,7 +4,7 @@ describe 'Public Group access' do
include AccessMatchers include AccessMatchers
let(:group) { create(:group, :public) } let(:group) { create(:group, :public) }
let(:project) { create(:project, :public, group: group) } let(:project) { create(:empty_project, :public, group: group) }
let(:project_guest) do let(:project_guest) do
create(:user) do |user| create(:user) do |user|
project.add_guest(user) project.add_guest(user)
...@@ -49,6 +49,7 @@ describe 'Public Group access' do ...@@ -49,6 +49,7 @@ describe 'Public Group access' do
end end
describe 'GET /groups/:path/merge_requests' do describe 'GET /groups/:path/merge_requests' do
let(:project) { create(:project, :public, :repository, group: group) }
subject { merge_requests_group_path(group) } subject { merge_requests_group_path(group) }
it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:admin) }
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe "Internal Project Access" do describe "Internal Project Access" do
include AccessMatchers include AccessMatchers
set(:project) { create(:project, :internal) } set(:project) { create(:project, :internal, :repository) }
describe "Project should be internal" do describe "Project should be internal" do
describe '#internal?' do describe '#internal?' do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe "Private Project Access" do describe "Private Project Access" do
include AccessMatchers include AccessMatchers
set(:project) { create(:project, :private, public_builds: false) } set(:project) { create(:project, :private, :repository, public_builds: false) }
describe "Project should be private" do describe "Project should be private" do
describe '#private?' do describe '#private?' do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe "Public Project Access" do describe "Public Project Access" do
include AccessMatchers include AccessMatchers
set(:project) { create(:project, :public) } set(:project) { create(:project, :public, :repository) }
describe "Project should be public" do describe "Project should be public" do
describe '#public?' do describe '#public?' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment