Commit 8626cdc3 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rs-empty_project-features' into 'master'

Use `:empty_project` where possible in feature specs

See merge request !13118
parents 850a2254 abe39684
require 'spec_helper' require 'spec_helper'
feature 'Admin::HookLogs' do feature 'Admin::HookLogs' do
let(:project) { create(:project) } let(:project) { create(:empty_project) }
let(:system_hook) { create(:system_hook) } let(:system_hook) { create(:system_hook) }
let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') } let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin::Hooks' do describe 'Admin::Hooks' do
before do before do
@project = create(:project) @project = create(:empty_project)
sign_in(create(:admin)) sign_in(create(:admin))
@system_hook = create(:system_hook) @system_hook = create(:system_hook)
......
...@@ -4,17 +4,18 @@ describe "Admin::Projects" do ...@@ -4,17 +4,18 @@ describe "Admin::Projects" do
include Select2Helper include Select2Helper
let(:user) { create :user } let(:user) { create :user }
let!(:project) { create(:project) } let(:project) { create(:empty_project) }
let!(:current_user) { create(:admin) } let(:current_user) { create(:admin) }
before do before do
sign_in(current_user) sign_in(current_user)
end end
describe "GET /admin/projects" do describe "GET /admin/projects" do
let!(:archived_project) { create :project, :public, :archived } let!(:archived_project) { create :empty_project, :public, :archived }
before do before do
expect(project).to be_persisted
visit admin_projects_path visit admin_projects_path
end end
...@@ -39,15 +40,14 @@ describe "Admin::Projects" do ...@@ -39,15 +40,14 @@ describe "Admin::Projects" do
describe "GET /admin/projects/:namespace_id/:id" do describe "GET /admin/projects/:namespace_id/:id" do
before do before do
visit admin_projects_path expect(project).to be_persisted
click_link "#{project.name}"
end
it do visit admin_projects_path
expect(current_path).to eq admin_project_path(project) click_link project.name
end end
it "has project info" do it "has project info" do
expect(current_path).to eq admin_project_path(project)
expect(page).to have_content(project.path) expect(page).to have_content(project.path)
expect(page).to have_content(project.name) expect(page).to have_content(project.name)
expect(page).to have_content(project.name_with_namespace) expect(page).to have_content(project.name_with_namespace)
...@@ -56,6 +56,9 @@ describe "Admin::Projects" do ...@@ -56,6 +56,9 @@ describe "Admin::Projects" do
end end
describe 'transfer project' do describe 'transfer project' do
# The gitlab-shell transfer will fail for a project without a repository
let(:project) { create(:project, :repository) }
before do before do
create(:group, name: 'Web') create(:group, name: 'Web')
......
...@@ -257,7 +257,7 @@ describe "Admin::Users" do ...@@ -257,7 +257,7 @@ describe "Admin::Users" do
describe "GET /admin/users/:id/projects" do describe "GET /admin/users/:id/projects" do
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:project) { create(:project, group: group) } let!(:project) { create(:empty_project, group: group) }
before do before do
group.add_developer(user) group.add_developer(user)
......
...@@ -4,8 +4,8 @@ describe "Dashboard Issues Feed" do ...@@ -4,8 +4,8 @@ describe "Dashboard Issues Feed" do
describe "GET /issues" do describe "GET /issues" do
let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') }
let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') }
let!(:project1) { create(:project) } let!(:project1) { create(:empty_project) }
let!(:project2) { create(:project) } let!(:project2) { create(:empty_project) }
before do before do
project1.team << [user, :master] project1.team << [user, :master]
......
...@@ -19,7 +19,7 @@ describe "Dashboard Feed" do ...@@ -19,7 +19,7 @@ describe "Dashboard Feed" do
end end
context 'feed content' do context 'feed content' do
let(:project) { create(:project) } let(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project, author: user, description: '') } let(:issue) { create(:issue, project: project, author: user, description: '') }
let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) } let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) }
......
...@@ -5,7 +5,7 @@ describe 'Issues Feed' do ...@@ -5,7 +5,7 @@ describe 'Issues Feed' do
let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') }
let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:project) { create(:project) } let!(:project) { create(:empty_project) }
let!(:issue) { create(:issue, author: user, assignees: [assignee], project: project) } let!(:issue) { create(:issue, author: user, assignees: [assignee], project: project) }
before do before do
......
...@@ -19,7 +19,7 @@ describe "User Feed" do ...@@ -19,7 +19,7 @@ describe "User Feed" do
end end
context 'feed content' do context 'feed content' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:issue) do let(:issue) do
create(:issue, create(:issue,
project: project, project: project,
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Archived Project' do RSpec.describe 'Dashboard Archived Project' do
let(:user) { create :user } let(:user) { create :user }
let(:project) { create :project} let(:project) { create :project}
let(:archived_project) { create(:project, :archived) } let(:archived_project) { create(:empty_project, :archived) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Tooltips on .timeago dates', js: true do feature 'Tooltips on .timeago dates', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) }
let(:created_date) { Date.yesterday.to_time } let(:created_date) { Date.yesterday.to_time }
let(:expected_format) { created_date.in_time_zone.strftime('%b %-d, %Y %l:%M%P') } let(:expected_format) { created_date.in_time_zone.strftime('%b %-d, %Y %l:%M%P') }
......
...@@ -2,8 +2,8 @@ require 'spec_helper' ...@@ -2,8 +2,8 @@ require 'spec_helper'
describe 'Dashboard > label filter', js: true do describe 'Dashboard > label filter', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) }
let(:project2) { create(:project, name: 'test2', path: 'test2', namespace: user.namespace) } let(:project2) { create(:empty_project, name: 'test2', path: 'test2', namespace: user.namespace) }
let(:label) { create(:label, title: 'bug', color: '#ff0000') } let(:label) { create(:label, title: 'bug', color: '#ff0000') }
let(:label2) { create(:label, title: 'bug') } let(:label2) { create(:label, title: 'bug') }
......
...@@ -4,7 +4,7 @@ feature 'Dashboard > milestone filter', :js do ...@@ -4,7 +4,7 @@ feature 'Dashboard > milestone filter', :js do
include FilterItemSelectHelper include FilterItemSelectHelper
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) }
let(:milestone) { create(:milestone, title: 'v1.0', project: project) } let(:milestone) { create(:milestone, title: 'v1.0', project: project) }
let(:milestone2) { create(:milestone, title: 'v2.0', project: project) } let(:milestone2) { create(:milestone, title: 'v2.0', project: project) }
let!(:issue) { create :issue, author: user, project: project, milestone: milestone } let!(:issue) { create :issue, author: user, project: project, milestone: milestone }
......
...@@ -3,7 +3,7 @@ require 'rails_helper' ...@@ -3,7 +3,7 @@ require 'rails_helper'
feature 'Dashboard > Todo target states' do feature 'Dashboard > Todo target states' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Dashboard Todos' do feature 'Dashboard Todos' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, due_date: Date.today) } let(:issue) { create(:issue, due_date: Date.today) }
context 'User does not have todos' do context 'User does not have todos' do
...@@ -212,7 +212,7 @@ feature 'Dashboard Todos' do ...@@ -212,7 +212,7 @@ feature 'Dashboard Todos' do
note1 = create(:note_on_issue, note: "Hello #{label1.to_reference(format: :name)}", noteable_id: issue.id, noteable_type: 'Issue', project: issue.project) note1 = create(:note_on_issue, note: "Hello #{label1.to_reference(format: :name)}", noteable_id: issue.id, noteable_type: 'Issue', project: issue.project)
create(:todo, :mentioned, project: project, target: issue, user: user, note_id: note1.id) create(:todo, :mentioned, project: project, target: issue, user: user, note_id: note1.id)
project2 = create(:project, :public) project2 = create(:empty_project, :public)
label2 = create(:label, project: project2) label2 = create(:label, project: project2)
issue2 = create(:issue, project: project2) issue2 = create(:issue, project: project2)
note2 = create(:note_on_issue, note: "Test #{label2.to_reference(format: :name)}", noteable_id: issue2.id, noteable_type: 'Issue', project: project2) note2 = create(:note_on_issue, note: "Test #{label2.to_reference(format: :name)}", noteable_id: issue2.id, noteable_type: 'Issue', project: project2)
......
...@@ -2,9 +2,9 @@ require 'spec_helper' ...@@ -2,9 +2,9 @@ require 'spec_helper'
describe 'Dashboard > User filters projects' do describe 'Dashboard > User filters projects' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'Victorialand', namespace: user.namespace) } let(:project) { create(:empty_project, name: 'Victorialand', namespace: user.namespace) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:project2) { create(:project, name: 'Treasure', namespace: user2.namespace) } let(:project2) { create(:empty_project, name: 'Treasure', namespace: user2.namespace) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -4,7 +4,7 @@ feature 'Top Plus Menu', :js do ...@@ -4,7 +4,7 @@ feature 'Top Plus Menu', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) } let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) }
let(:public_project) { create(:project, :public) } let(:public_project) { create(:empty_project, :public) }
before do before do
group.add_owner(user) group.add_owner(user)
......
...@@ -49,7 +49,7 @@ feature 'Edit group settings' do ...@@ -49,7 +49,7 @@ feature 'Edit group settings' do
end end
context 'with a project' do context 'with a project' do
given!(:project) { create(:project, group: group, path: 'project') } given!(:project) { create(:empty_project, group: group) }
given(:old_project_full_path) { "/#{group.path}/#{project.path}" } given(:old_project_full_path) { "/#{group.path}/#{project.path}" }
given(:new_project_full_path) { "/#{new_group_path}/#{project.path}" } given(:new_project_full_path) { "/#{new_group_path}/#{project.path}" }
...@@ -65,14 +65,14 @@ feature 'Edit group settings' do ...@@ -65,14 +65,14 @@ feature 'Edit group settings' do
update_path(new_group_path) update_path(new_group_path)
visit new_project_full_path visit new_project_full_path
expect(current_path).to eq(new_project_full_path) expect(current_path).to eq(new_project_full_path)
expect(find('h1.project-title')).to have_content(project.name) expect(find('h1.title')).to have_content(project.path)
end end
scenario 'the old project path redirects to the new path' do scenario 'the old project path redirects to the new path' do
update_path(new_group_path) update_path(new_group_path)
visit old_project_full_path visit old_project_full_path
expect(current_path).to eq(new_project_full_path) expect(current_path).to eq(new_project_full_path)
expect(find('h1.project-title')).to have_content(project.name) expect(find('h1.title')).to have_content(project.path)
end end
end end
end end
......
...@@ -4,7 +4,7 @@ feature 'Groups > Members > Request access' do ...@@ -4,7 +4,7 @@ feature 'Groups > Members > Request access' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:owner) { create(:user) } let(:owner) { create(:user) }
let(:group) { create(:group, :public, :access_requestable) } let(:group) { create(:group, :public, :access_requestable) }
let!(:project) { create(:project, :private, namespace: group) } let!(:project) { create(:empty_project, :private, namespace: group) }
background do background do
group.add_owner(owner) group.add_owner(owner)
......
...@@ -7,7 +7,7 @@ feature 'Group merge requests page' do ...@@ -7,7 +7,7 @@ feature 'Group merge requests page' do
include_examples 'project features apply to issuables', MergeRequest include_examples 'project features apply to issuables', MergeRequest
context 'archived issuable' do context 'archived issuable' do
let(:project_archived) { create(:project, :archived, :merge_requests_enabled, group: group) } let(:project_archived) { create(:project, :archived, :merge_requests_enabled, :repository, group: group) }
let(:issuable_archived) { create(:merge_request, source_project: project_archived, target_project: project_archived, title: 'issuable of an archived project') } let(:issuable_archived) { create(:merge_request, source_project: project_archived, target_project: project_archived, title: 'issuable of an archived project') }
let(:access_level) { ProjectFeature::ENABLED } let(:access_level) { ProjectFeature::ENABLED }
let(:user) { user_in_group } let(:user) { user_in_group }
......
...@@ -79,7 +79,7 @@ describe 'Issuables Close/Reopen/Report toggle' do ...@@ -79,7 +79,7 @@ describe 'Issuables Close/Reopen/Report toggle' do
end end
context 'on a merge request' do context 'on a merge request' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:issuable) { create(:merge_request, source_project: project) } let(:issuable) { create(:merge_request, source_project: project) }
before do before do
...@@ -96,7 +96,7 @@ describe 'Issuables Close/Reopen/Report toggle' do ...@@ -96,7 +96,7 @@ describe 'Issuables Close/Reopen/Report toggle' do
end end
context 'when user doesnt have permission to update' do context 'when user doesnt have permission to update' do
let(:cant_project) { create(:project) } let(:cant_project) { create(:project, :repository) }
let(:cant_issuable) { create(:merge_request, source_project: cant_project) } let(:cant_issuable) { create(:merge_request, source_project: cant_project) }
before do before do
......
...@@ -3,7 +3,7 @@ require 'rails_helper' ...@@ -3,7 +3,7 @@ require 'rails_helper'
describe 'Issue Sidebar on Mobile' do describe 'Issue Sidebar on Mobile' do
include MobileHelpers include MobileHelpers
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
......
require 'rails_helper' require 'rails_helper'
describe 'Awards Emoji' do describe 'Awards Emoji' do
let!(:project) { create(:project, :public) } let!(:project) { create(:empty_project, :public) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
let(:issue) do let(:issue) do
create(:issue, create(:issue,
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Issue awards', js: true do feature 'Issue awards', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
describe 'logged in' do describe 'logged in' do
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Issues > Labels bulk assignment' do feature 'Issues > Labels bulk assignment' do
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:project) } let!(:project) { create(:empty_project) }
let!(:issue1) { create(:issue, project: project, title: "Issue 1") } let!(:issue1) { create(:issue, project: project, title: "Issue 1") }
let!(:issue2) { create(:issue, project: project, title: "Issue 2") } let!(:issue2) { create(:issue, project: project, title: "Issue 2") }
let!(:bug) { create(:label, project: project, title: 'bug') } let!(:bug) { create(:label, project: project, title: 'bug') }
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Create Branch/Merge Request Dropdown on issue page', js: true do feature 'Create Branch/Merge Request Dropdown on issue page', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:project) } let!(:project) { create(:project, :repository) }
let(:issue) { create(:issue, project: project, title: 'Cherry-Coloured Funk') } let(:issue) { create(:issue, project: project, title: 'Cherry-Coloured Funk') }
context 'for team members' do context 'for team members' do
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Resolving all open discussions in a merge request from an issue', js: true do feature 'Resolving all open discussions in a merge request from an issue', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion }
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Resolve an open discussion in a merge request by creating an issue' do feature 'Resolve an open discussion in a merge request by creating an issue' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, only_allow_merge_if_all_discussions_are_resolved: true) } let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion }
......
...@@ -5,7 +5,7 @@ describe 'Filter issues', js: true do ...@@ -5,7 +5,7 @@ describe 'Filter issues', js: true do
include FilteredSearchHelpers include FilteredSearchHelpers
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:project) { create(:project, group: group) } let!(:project) { create(:empty_project, group: group) }
let!(:user) { create(:user, username: 'joe', name: 'Joe') } let!(:user) { create(:user, username: 'joe', name: 'Joe') }
let!(:user2) { create(:user, username: 'jane') } let!(:user2) { create(:user, username: 'jane') }
let!(:label) { create(:label, project: project) } let!(:label) { create(:label, project: project) }
......
...@@ -4,7 +4,7 @@ describe 'New/edit issue', :js do ...@@ -4,7 +4,7 @@ describe 'New/edit issue', :js do
include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::JavaScriptHelper
include FormHelper include FormHelper
let!(:project) { create(:project) } let!(:project) { create(:empty_project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
let!(:user2) { create(:user)} let!(:user2) { create(:user)}
let!(:milestone) { create(:milestone, project: project) } let!(:milestone) { create(:milestone, project: project) }
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'GFM autocomplete', js: true do feature 'GFM autocomplete', js: true do
let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') }
let(:project) { create(:project) } let(:project) { create(:empty_project) }
let(:label) { create(:label, project: project, title: 'special+') } let(:label) { create(:label, project: project, title: 'special+') }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Issue Detail', :js do feature 'Issue Detail', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, project: project, author: user) } let(:issue) { create(:issue, project: project, author: user) }
context 'when user displays the issue' do context 'when user displays the issue' do
......
...@@ -4,7 +4,7 @@ feature 'Issue Sidebar' do ...@@ -4,7 +4,7 @@ feature 'Issue Sidebar' do
include MobileHelpers include MobileHelpers
let(:group) { create(:group, :nested) } let(:group) { create(:group, :nested) }
let(:project) { create(:project, :public, namespace: group) } let(:project) { create(:empty_project, :public, namespace: group) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
let!(:label) { create(:label, project: project, title: 'bug') } let!(:label) { create(:label, project: project, title: 'bug') }
......
require 'rails_helper' require 'rails_helper'
feature 'Issue markdown toolbar', js: true do feature 'Issue markdown toolbar', js: true do
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'issue move to another project' do feature 'issue move to another project' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:old_project) { create(:project) } let(:old_project) { create(:project, :repository) }
let(:text) { 'Some issue description' } let(:text) { 'Some issue description' }
let(:issue) do let(:issue) do
...@@ -25,8 +25,8 @@ feature 'issue move to another project' do ...@@ -25,8 +25,8 @@ feature 'issue move to another project' do
context 'user has permission to move issue' do context 'user has permission to move issue' do
let!(:mr) { create(:merge_request, source_project: old_project) } let!(:mr) { create(:merge_request, source_project: old_project) }
let(:new_project) { create(:project) } let(:new_project) { create(:empty_project) }
let(:new_project_search) { create(:project) } let(:new_project_search) { create(:empty_project) }
let(:text) { "Text with #{mr.to_reference}" } let(:text) { "Text with #{mr.to_reference}" }
let(:cross_reference) { old_project.to_reference(new_project) } let(:cross_reference) { old_project.to_reference(new_project) }
...@@ -63,8 +63,8 @@ feature 'issue move to another project' do ...@@ -63,8 +63,8 @@ feature 'issue move to another project' do
end end
context 'user does not have permission to move the issue to a project', js: true do context 'user does not have permission to move the issue to a project', js: true do
let!(:private_project) { create(:project, :private) } let!(:private_project) { create(:empty_project, :private) }
let(:another_project) { create(:project) } let(:another_project) { create(:empty_project) }
background { another_project.team << [user, :guest] } background { another_project.team << [user, :guest] }
scenario 'browsing projects in projects select' do scenario 'browsing projects in projects select' do
......
...@@ -35,42 +35,42 @@ describe 'Create notes on issues', :js do ...@@ -35,42 +35,42 @@ describe 'Create notes on issues', :js do
context 'mentioning issue on a private project' do context 'mentioning issue on a private project' do
it_behaves_like 'notes with reference' do it_behaves_like 'notes with reference' do
let(:project) { create(:project, :private) } let(:project) { create(:empty_project, :private) }
let(:mention) { create(:issue, project: project) } let(:mention) { create(:issue, project: project) }
end end
end end
context 'mentioning issue on an internal project' do context 'mentioning issue on an internal project' do
it_behaves_like 'notes with reference' do it_behaves_like 'notes with reference' do
let(:project) { create(:project, :internal) } let(:project) { create(:empty_project, :internal) }
let(:mention) { create(:issue, project: project) } let(:mention) { create(:issue, project: project) }
end end
end end
context 'mentioning issue on a public project' do context 'mentioning issue on a public project' do
it_behaves_like 'notes with reference' do it_behaves_like 'notes with reference' do
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:mention) { create(:issue, project: project) } let(:mention) { create(:issue, project: project) }
end end
end end
context 'mentioning merge request on a private project' do context 'mentioning merge request on a private project' do
it_behaves_like 'notes with reference' do it_behaves_like 'notes with reference' do
let(:project) { create(:project, :private) } let(:project) { create(:project, :private, :repository) }
let(:mention) { create(:merge_request, source_project: project) } let(:mention) { create(:merge_request, source_project: project) }
end end
end end
context 'mentioning merge request on an internal project' do context 'mentioning merge request on an internal project' do
it_behaves_like 'notes with reference' do it_behaves_like 'notes with reference' do
let(:project) { create(:project, :internal) } let(:project) { create(:project, :internal, :repository) }
let(:mention) { create(:merge_request, source_project: project) } let(:mention) { create(:merge_request, source_project: project) }
end end
end end
context 'mentioning merge request on a public project' do context 'mentioning merge request on a public project' do
it_behaves_like 'notes with reference' do it_behaves_like 'notes with reference' do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:mention) { create(:merge_request, source_project: project) } let(:mention) { create(:merge_request, source_project: project) }
end end
end end
......
...@@ -3,7 +3,7 @@ require 'rails_helper' ...@@ -3,7 +3,7 @@ require 'rails_helper'
describe 'New issue', js: true do describe 'New issue', js: true do
include StubENV include StubENV
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:user) { create(:user)} let(:user) { create(:user)}
before do before do
......
require 'rails_helper' require 'rails_helper'
feature 'Manually create a todo item from issue', js: true do feature 'Manually create a todo item from issue', js: true do
let!(:project) { create(:project) } let!(:project) { create(:empty_project) }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
before do before do
project.team << [user, :master] project.team << [user, :master]
......
require 'rails_helper' require 'rails_helper'
feature 'Multiple issue updating from issues#index', :js do feature 'Multiple issue updating from issues#index', :js do
let!(:project) { create(:project) } let!(:project) { create(:empty_project) }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
......
...@@ -9,7 +9,7 @@ feature 'Issues > User uses quick actions', js: true do ...@@ -9,7 +9,7 @@ feature 'Issues > User uses quick actions', js: true do
describe 'issue-only commands' do describe 'issue-only commands' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Merge request issue assignment', js: true do feature 'Merge request issue assignment', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:issue1) { create(:issue, project: project) } let(:issue1) { create(:issue, project: project) }
let(:issue2) { create(:issue, project: project) } let(:issue2) { create(:issue, project: project) }
let(:merge_request) { create(:merge_request, :simple, source_project: project, author: user, description: "fixes #{issue1.to_reference} and #{issue2.to_reference}") } let(:merge_request) { create(:merge_request, :simple, source_project: project, author: user, description: "fixes #{issue1.to_reference} and #{issue2.to_reference}") }
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Merge request awards', js: true do feature 'Merge request awards', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
describe 'logged in' do describe 'logged in' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Check if mergeable with unresolved discussions', js: true do feature 'Check if mergeable with unresolved discussions', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let!(:merge_request) { create(:merge_request_with_diff_notes, source_project: project, author: user) } let!(:merge_request) { create(:merge_request_with_diff_notes, source_project: project, author: user) }
before do before do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Cherry-pick Merge Requests', js: true do describe 'Cherry-pick Merge Requests', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:project, :repository, namespace: group) }
let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user) } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user) }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Merge Request closing issues message', js: true do feature 'Merge Request closing issues message', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:issue_1) { create(:issue, project: project)} let(:issue_1) { create(:issue, project: project)}
let(:issue_2) { create(:issue, project: project)} let(:issue_2) { create(:issue, project: project)}
let(:merge_request) do let(:merge_request) do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Merge request conflict resolution', js: true do feature 'Merge request conflict resolution', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
before do before do
# In order to have the diffs collapsed, we need to disable the increase feature # In order to have the diffs collapsed, we need to disable the increase feature
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Create New Merge Request', js: true do feature 'Create New Merge Request', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
before do before do
project.team << [user, :master] project.team << [user, :master]
...@@ -63,7 +63,7 @@ feature 'Create New Merge Request', js: true do ...@@ -63,7 +63,7 @@ feature 'Create New Merge Request', js: true do
context 'when target project cannot be viewed by the current user' do context 'when target project cannot be viewed by the current user' do
it 'does not leak the private project name & namespace' do it 'does not leak the private project name & namespace' do
private_project = create(:project, :private) private_project = create(:project, :private, :repository)
visit project_new_merge_request_path(project, merge_request: { target_project_id: private_project.id }) visit project_new_merge_request_path(project, merge_request: { target_project_id: private_project.id })
...@@ -74,7 +74,7 @@ feature 'Create New Merge Request', js: true do ...@@ -74,7 +74,7 @@ feature 'Create New Merge Request', js: true do
context 'when source project cannot be viewed by the current user' do context 'when source project cannot be viewed by the current user' do
it 'does not leak the private project name & namespace' do it 'does not leak the private project name & namespace' do
private_project = create(:project, :private) private_project = create(:project, :private, :repository)
visit project_new_merge_request_path(project, merge_request: { source_project_id: private_project.id }) visit project_new_merge_request_path(project, merge_request: { source_project_id: private_project.id })
......
...@@ -2,8 +2,8 @@ require 'spec_helper' ...@@ -2,8 +2,8 @@ require 'spec_helper'
feature 'Merge request created from fork' do feature 'Merge request created from fork' do
given(:user) { create(:user) } given(:user) { create(:user) }
given(:project) { create(:project, :public) } given(:project) { create(:project, :public, :repository) }
given(:fork_project) { create(:project, :public) } given(:fork_project) { create(:project, :public, :repository) }
given!(:merge_request) do given!(:merge_request) do
create(:forked_project_link, forked_to_project: fork_project, create(:forked_project_link, forked_to_project: fork_project,
......
...@@ -4,7 +4,7 @@ feature 'Diff note avatars', js: true do ...@@ -4,7 +4,7 @@ feature 'Diff note avatars', js: true do
include NoteInteractionHelpers include NoteInteractionHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") }
let(:path) { "files/ruby/popen.rb" } let(:path) { "files/ruby/popen.rb" }
let(:position) do let(:position) do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Diff notes resolve', js: true do feature 'Diff notes resolve', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") }
let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request) } let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request) }
let(:path) { "files/ruby/popen.rb" } let(:path) { "files/ruby/popen.rb" }
......
require 'spec_helper' require 'spec_helper'
feature 'Diffs URL', js: true do feature 'Diffs URL', js: true do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
context 'when visit with */* as accept header' do context 'when visit with */* as accept header' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Edit Merge Request' do feature 'Edit Merge Request' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, :simple, source_project: project) } let(:merge_request) { create(:merge_request, :simple, source_project: project) }
before do before do
......
require 'rails_helper' require 'rails_helper'
feature 'Issue filtering by Labels', js: true do feature 'Merge Request filtering by Labels', js: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include MergeRequestHelpers include MergeRequestHelpers
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:label) { create(:label, project: project) } let!(:label) { create(:label, project: project) }
......
...@@ -4,7 +4,7 @@ feature 'Merge Request filtering by Milestone' do ...@@ -4,7 +4,7 @@ feature 'Merge Request filtering by Milestone' do
include FilteredSearchHelpers include FilteredSearchHelpers
include MergeRequestHelpers include MergeRequestHelpers
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
let(:milestone) { create(:milestone, project: project) } let(:milestone) { create(:milestone, project: project) }
......
...@@ -4,7 +4,7 @@ describe 'Filter merge requests' do ...@@ -4,7 +4,7 @@ describe 'Filter merge requests' do
include FilteredSearchHelpers include FilteredSearchHelpers
include MergeRequestHelpers include MergeRequestHelpers
let!(:project) { create(:project) } let!(:project) { create(:project, :repository) }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:milestone) { create(:milestone, project: project) } let!(:milestone) { create(:milestone, project: project) }
......
require 'rails_helper' require 'rails_helper'
describe 'New/edit merge request', :js do describe 'New/edit merge request', :js do
let!(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let!(:project) { create(:project, :public, :repository) }
let(:fork_project) { create(:project, forked_from_project: project) } let(:fork_project) { create(:project, :repository, forked_from_project: project) }
let!(:user) { create(:user)} let!(:user) { create(:user) }
let!(:user2) { create(:user)} let!(:user2) { create(:user) }
let!(:milestone) { create(:milestone, project: project) } let!(:milestone) { create(:milestone, project: project) }
let!(:label) { create(:label, project: project) } let!(:label) { create(:label, project: project) }
let!(:label2) { create(:label, project: project) } let!(:label2) { create(:label, project: project) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Clicking toggle commit message link', js: true do feature 'Clicking toggle commit message link', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:issue_1) { create(:issue, project: project)} let(:issue_1) { create(:issue, project: project)}
let(:issue_2) { create(:issue, project: project)} let(:issue_2) { create(:issue, project: project)}
let(:merge_request) do let(:merge_request) do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Merge immediately', :js do feature 'Merge immediately', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let!(:merge_request) do let!(:merge_request) do
create(:merge_request_with_diffs, source_project: project, create(:merge_request_with_diffs, source_project: project,
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Merge When Pipeline Succeeds', :js do feature 'Merge When Pipeline Succeeds', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, source_project: project, create(:merge_request_with_diffs, source_project: project,
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Mini Pipeline Graph', :js do feature 'Mini Pipeline Graph', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, head_pipeline: pipeline) } let(:merge_request) { create(:merge_request, source_project: project, head_pipeline: pipeline) }
let(:pipeline) { create(:ci_empty_pipeline, project: project, ref: 'master', status: 'running', sha: project.commit.id) } let(:pipeline) { create(:ci_empty_pipeline, project: project, ref: 'master', status: 'running', sha: project.commit.id) }
......
...@@ -5,7 +5,7 @@ feature 'Merge requests filter clear button', js: true do ...@@ -5,7 +5,7 @@ feature 'Merge requests filter clear button', js: true do
include MergeRequestHelpers include MergeRequestHelpers
include IssueHelpers include IssueHelpers
let!(:project) { create(:project, :public) } let!(:project) { create(:project, :public, :repository) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:milestone) { create(:milestone, project: project) } let!(:milestone) { create(:milestone, project: project) }
let!(:bug) { create(:label, project: project, name: 'bug')} let!(:bug) { create(:label, project: project, name: 'bug')}
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'toggler_behavior', js: true do feature 'toggler_behavior', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, author: user) } let(:merge_request) { create(:merge_request, source_project: project, author: user) }
let(:note) { create(:diff_note_on_merge_request, noteable: merge_request, project: project) } let(:note) { create(:diff_note_on_merge_request, noteable: merge_request, project: project) }
let(:fragment_id) { "#note_#{note.id}" } let(:fragment_id) { "#note_#{note.id}" }
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Multiple merge requests updating from merge_requests#index' do feature 'Multiple merge requests updating from merge_requests#index' do
let!(:user) { create(:user)} let!(:user) { create(:user)}
let!(:project) { create(:project) } let!(:project) { create(:project, :repository) }
let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
before do before do
......
...@@ -4,7 +4,7 @@ describe 'Projects > Merge requests > User lists merge requests' do ...@@ -4,7 +4,7 @@ describe 'Projects > Merge requests > User lists merge requests' do
include MergeRequestHelpers include MergeRequestHelpers
include SortingHelper include SortingHelper
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Merge requests > User posts notes', :js do describe 'Merge requests > User posts notes', :js do
include NoteInteractionHelpers include NoteInteractionHelpers
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:merge_request) do let(:merge_request) do
create(:merge_request, source_project: project, target_project: project) create(:merge_request, source_project: project, target_project: project)
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Merge requests > User sees system notes' do feature 'Merge requests > User sees system notes' do
let(:public_project) { create(:project, :public) } let(:public_project) { create(:project, :public, :repository) }
let(:private_project) { create(:project, :private) } let(:private_project) { create(:project, :private, :repository) }
let(:issue) { create(:issue, project: private_project) } let(:issue) { create(:issue, project: private_project) }
let(:merge_request) { create(:merge_request, source_project: public_project, source_branch: 'markdown') } let(:merge_request) { create(:merge_request, source_project: public_project, source_branch: 'markdown') }
let!(:note) { create(:note_on_merge_request, :system, noteable: merge_request, project: public_project, note: "mentioned in #{issue.to_reference(public_project)}") } let!(:note) { create(:note_on_merge_request, :system, noteable: merge_request, project: public_project, note: "mentioned in #{issue.to_reference(public_project)}") }
......
...@@ -4,7 +4,7 @@ feature 'Merge Requests > User uses quick actions', js: true do ...@@ -4,7 +4,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
include QuickActionsHelpers include QuickActionsHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
let!(:milestone) { create(:milestone, project: project, title: 'ASAP') } let!(:milestone) { create(:milestone, project: project, title: 'ASAP') }
...@@ -129,7 +129,7 @@ feature 'Merge Requests > User uses quick actions', js: true do ...@@ -129,7 +129,7 @@ feature 'Merge Requests > User uses quick actions', js: true do
end end
describe '/target_branch command in merge request' do describe '/target_branch command in merge request' do
let(:another_project) { create(:project, :public) } let(:another_project) { create(:project, :public, :repository) }
let(:new_url_opts) { { merge_request: { source_branch: 'feature' } } } let(:new_url_opts) { { merge_request: { source_branch: 'feature' } } }
before do before do
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
describe 'Merge request', :js do describe 'Merge request', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
before do before do
...@@ -200,7 +200,7 @@ describe 'Merge request', :js do ...@@ -200,7 +200,7 @@ describe 'Merge request', :js do
end end
context 'user can merge into source project but cannot push to fork', js: true do context 'user can merge into source project but cannot push to fork', js: true do
let(:fork_project) { create(:project, :public) } let(:fork_project) { create(:project, :public, :repository) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
before do before do
......
require 'spec_helper' require 'spec_helper'
feature 'Work In Progress help message' do feature 'Work In Progress help message' do
let!(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let!(:project) { create(:project, :public, :repository) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
before do before do
......
...@@ -27,7 +27,7 @@ feature 'Profile > Account' do ...@@ -27,7 +27,7 @@ feature 'Profile > Account' do
end end
context 'with a project' do context 'with a project' do
given!(:project) { create(:project, namespace: user.namespace, path: 'project') } given!(:project) { create(:empty_project, namespace: user.namespace) }
given(:new_project_path) { "/#{new_username}/#{project.path}" } given(:new_project_path) { "/#{new_username}/#{project.path}" }
given(:old_project_path) { "/#{user.username}/#{project.path}" } given(:old_project_path) { "/#{user.username}/#{project.path}" }
...@@ -43,14 +43,14 @@ feature 'Profile > Account' do ...@@ -43,14 +43,14 @@ feature 'Profile > Account' do
update_username(new_username) update_username(new_username)
visit new_project_path visit new_project_path
expect(current_path).to eq(new_project_path) expect(current_path).to eq(new_project_path)
expect(find('h1.project-title')).to have_content(project.name) expect(find('h1.title')).to have_content(project.path)
end end
scenario 'the old project path redirects to the new path' do scenario 'the old project path redirects to the new path' do
update_username(new_username) update_username(new_username)
visit old_project_path visit old_project_path
expect(current_path).to eq(new_project_path) expect(current_path).to eq(new_project_path)
expect(find('h1.project-title')).to have_content(project.name) expect(find('h1.title')).to have_content(project.path)
end end
end end
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Browse artifact', :js do feature 'Browse artifact', :js do
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:pipeline) { create(:ci_empty_pipeline, project: project, sha: project.commit.sha, ref: 'master') } let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
def browse_path(path) def browse_path(path)
......
require 'spec_helper' require 'spec_helper'
feature 'Download artifact', :js do feature 'Download artifact', :js do
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:pipeline) { create(:ci_empty_pipeline, status: :success, project: project, sha: project.commit.sha, ref: 'master') } let(:pipeline) { create(:ci_empty_pipeline, status: :success, project: project) }
let(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) } let(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) }
shared_examples 'downloading' do shared_examples 'downloading' do
......
require 'spec_helper' require 'spec_helper'
feature 'Artifact file', :js do feature 'Artifact file', :js do
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:pipeline) { create(:ci_empty_pipeline, project: project, sha: project.commit.sha, ref: 'master') } let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) } let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) }
def visit_file(path) def visit_file(path)
......
require 'spec_helper' require 'spec_helper'
feature 'Raw artifact', :js do feature 'Raw artifact', :js do
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:pipeline) { create(:ci_empty_pipeline, project: project, sha: project.commit.sha, ref: 'master') } let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
def raw_path(path) def raw_path(path)
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'test coverage badge' do feature 'test coverage badge' do
given!(:user) { create(:user) } given!(:user) { create(:user) }
given!(:project) { create(:project, :private) } given!(:project) { create(:empty_project, :private) }
context 'when user has access to view badge' do context 'when user has access to view badge' do
background do background do
...@@ -55,7 +55,7 @@ feature 'test coverage badge' do ...@@ -55,7 +55,7 @@ feature 'test coverage badge' do
end end
def create_pipeline def create_pipeline
opts = { project: project, ref: 'master', sha: project.commit.id } opts = { project: project }
create(:ci_pipeline, opts).tap do |pipeline| create(:ci_pipeline, opts).tap do |pipeline|
yield pipeline yield pipeline
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'list of badges' do feature 'list of badges' do
background do background do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project, :repository)
project.team << [user, :master] project.team << [user, :master]
sign_in(user) sign_in(user)
visit project_pipelines_settings_path(project) visit project_pipelines_settings_path(project)
......
require 'spec_helper' require 'spec_helper'
feature 'File blob', :js do feature 'File blob', :js do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
def visit_blob(path, anchor: nil, ref: 'master') def visit_blob(path, anchor: nil, ref: 'master')
visit project_blob_path(project, File.join(ref, path), anchor: anchor) visit project_blob_path(project, File.join(ref, path), anchor: anchor)
......
...@@ -4,7 +4,7 @@ feature 'Download buttons in branches page' do ...@@ -4,7 +4,7 @@ feature 'Download buttons in branches page' do
given(:user) { create(:user) } given(:user) { create(:user) }
given(:role) { :developer } given(:role) { :developer }
given(:status) { 'success' } given(:status) { 'success' }
given(:project) { create(:project) } given(:project) { create(:project, :repository) }
given(:pipeline) do given(:pipeline) do
create(:ci_pipeline, create(:ci_pipeline,
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'New Branch Ref Dropdown', :js do describe 'New Branch Ref Dropdown', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:toggle) { find('.create-from .dropdown-menu-toggle') } let(:toggle) { find('.create-from .dropdown-menu-toggle') }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Branches' do describe 'Branches' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:repository) { project.repository } let(:repository) { project.repository }
def set_protected_branch_name(branch_name) def set_protected_branch_name(branch_name)
......
require 'spec_helper' require 'spec_helper'
feature 'project commit pipelines', js: true do feature 'project commit pipelines', js: true do
given(:project) { create(:project) } given(:project) { create(:project, :repository) }
background do background do
user = create(:user) user = create(:user)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Cherry-pick Commits' do describe 'Cherry-pick Commits' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:project, :repository, namespace: group) }
let(:master_pickable_commit) { project.commit('7d3b0f7cff5f37573aea97cebfd5692ea1689924') } let(:master_pickable_commit) { project.commit('7d3b0f7cff5f37573aea97cebfd5692ea1689924') }
let(:master_pickable_merge) { project.commit('e56497bb5f03a90a51293fc6d516788730953899') } let(:master_pickable_merge) { project.commit('e56497bb5f03a90a51293fc6d516788730953899') }
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Mini Pipeline Graph in Commit View', :js do feature 'Mini Pipeline Graph in Commit View', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -2,7 +2,7 @@ require "spec_helper" ...@@ -2,7 +2,7 @@ require "spec_helper"
describe "Compare", js: true do describe "Compare", js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Project edit', js: true do feature 'Project edit', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:empty_project) }
before do before do
project.team << [user, :master] project.team << [user, :master]
...@@ -20,7 +20,7 @@ feature 'Project edit', js: true do ...@@ -20,7 +20,7 @@ feature 'Project edit', js: true do
end end
context 'given project with merge_requests_disabled access level' do context 'given project with merge_requests_disabled access level' do
let(:project) { create(:project, :merge_requests_disabled) } let(:project) { create(:empty_project, :merge_requests_disabled) }
it 'hides merge requests section' do it 'hides merge requests section' do
expect(page).to have_selector('.merge-requests-feature', visible: false) expect(page).to have_selector('.merge-requests-feature', visible: false)
...@@ -36,7 +36,7 @@ feature 'Project edit', js: true do ...@@ -36,7 +36,7 @@ feature 'Project edit', js: true do
end end
context 'given project with builds_disabled access level' do context 'given project with builds_disabled access level' do
let(:project) { create(:project, :builds_disabled) } let(:project) { create(:empty_project, :builds_disabled) }
it 'hides builds select section' do it 'hides builds select section' do
expect(page).to have_selector('.builds-feature', visible: false) expect(page).to have_selector('.builds-feature', visible: false)
......
...@@ -205,7 +205,7 @@ feature 'Environment' do ...@@ -205,7 +205,7 @@ feature 'Environment' do
end end
feature 'auto-close environment when branch is deleted' do feature 'auto-close environment when branch is deleted' do
given(:project) { create(:project) } given(:project) { create(:project, :repository) }
given!(:environment) do given!(:environment) do
create(:environment, :with_review_app, project: project, create(:environment, :with_review_app, project: project,
......
...@@ -111,7 +111,7 @@ feature 'Environments page', :js do ...@@ -111,7 +111,7 @@ feature 'Environments page', :js do
end end
context 'with deployments' do context 'with deployments' do
given(:project) { create(:project) } given(:project) { create(:project, :repository) }
given(:deployment) do given(:deployment) do
create(:deployment, environment: environment, create(:deployment, environment: environment,
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Edit Project Settings' do describe 'Edit Project Settings' do
let(:member) { create(:user) } let(:member) { create(:user) }
let!(:project) { create(:project, :public, path: 'gitlab', name: 'sample') } let!(:project) { create(:project, :public, :repository) }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
let(:non_member) { create(:user) } let(:non_member) { create(:user) }
...@@ -249,7 +249,7 @@ describe 'Edit Project Settings' do ...@@ -249,7 +249,7 @@ describe 'Edit Project Settings' do
# Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/24056 # Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/24056
describe 'project statistic visibility' do describe 'project statistic visibility' do
let!(:project) { create(:project, :private) } let!(:project) { create(:empty_project, :private) }
before do before do
project.team << [member, :guest] project.team << [member, :guest]
......
require 'spec_helper' require 'spec_helper'
feature 'user browses project', js: true do feature 'user browses project', js: true do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
require 'spec_helper' require 'spec_helper'
feature 'User wants to create a file' do feature 'User wants to create a file' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
background do background do
......
...@@ -4,7 +4,7 @@ require 'fileutils' ...@@ -4,7 +4,7 @@ require 'fileutils'
feature 'User wants to add a Dockerfile file' do feature 'User wants to add a Dockerfile file' do
before do before do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project, :repository)
project.team << [user, :master] project.team << [user, :master]
sign_in user sign_in user
......
...@@ -4,7 +4,7 @@ feature 'Download buttons in files tree' do ...@@ -4,7 +4,7 @@ feature 'Download buttons in files tree' do
given(:user) { create(:user) } given(:user) { create(:user) }
given(:role) { :developer } given(:role) { :developer }
given(:status) { 'success' } given(:status) { 'success' }
given(:project) { create(:project) } given(:project) { create(:project, :repository) }
given(:pipeline) do given(:pipeline) do
create(:ci_pipeline, create(:ci_pipeline,
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'User uses soft wrap whilst editing file', js: true do feature 'User uses soft wrap whilst editing file', js: true do
before do before do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project, :repository)
project.team << [user, :master] project.team << [user, :master]
sign_in user sign_in user
visit project_new_blob_path(project, 'master', file_name: 'test_file-name') visit project_new_blob_path(project, 'master', file_name: 'test_file-name')
......
require 'spec_helper' require 'spec_helper'
feature 'User wants to edit a file' do feature 'User wants to edit a file' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:commit_params) do let(:commit_params) do
{ {
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Find file keyboard shortcuts', js: true do feature 'Find file keyboard shortcuts', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Find files button in the tree header' do feature 'Find files button in the tree header' do
given(:user) { create(:user) } given(:user) { create(:user) }
given(:project) { create(:project) } given(:project) { create(:project, :repository) }
background do background do
sign_in(user) sign_in(user)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'User wants to add a .gitignore file' do feature 'User wants to add a .gitignore file' do
before do before do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project, :repository)
project.team << [user, :master] project.team << [user, :master]
sign_in user sign_in user
visit project_new_blob_path(project, 'master', file_name: '.gitignore') visit project_new_blob_path(project, 'master', file_name: '.gitignore')
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'User wants to add a .gitlab-ci.yml file' do feature 'User wants to add a .gitlab-ci.yml file' do
before do before do
user = create(:user) user = create(:user)
project = create(:project) project = create(:project, :repository)
project.team << [user, :master] project.team << [user, :master]
sign_in user sign_in user
visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml') visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml')
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'project owner creates a license file', js: true do feature 'project owner creates a license file', js: true do
let(:project_master) { create(:user) } let(:project_master) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
background do background do
project.repository.delete_file(project_master, 'LICENSE', project.repository.delete_file(project_master, 'LICENSE',
message: 'Remove LICENSE', branch_name: 'master') message: 'Remove LICENSE', branch_name: 'master')
......
require 'spec_helper' require 'spec_helper'
feature 'Template type dropdown selector', js: true do feature 'Template type dropdown selector', js: true do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
require 'spec_helper' require 'spec_helper'
feature 'Template Undo Button', js: true do feature 'Template Undo Button', js: true do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
require 'spec_helper' require 'spec_helper'
describe 'GFM autocomplete loading', js: true do describe 'GFM autocomplete loading', js: true do
let(:project) { create(:project) } let(:project) { create(:empty_project) }
before do before do
sign_in(create(:admin)) sign_in(create(:admin))
......
...@@ -4,7 +4,7 @@ feature 'Project group links', :js do ...@@ -4,7 +4,7 @@ feature 'Project group links', :js do
include Select2Helper include Select2Helper
let(:master) { create(:user) } let(:master) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:empty_project) }
let!(:group) { create(:group) } let!(:group) { create(:group) }
background do background do
...@@ -35,7 +35,7 @@ feature 'Project group links', :js do ...@@ -35,7 +35,7 @@ feature 'Project group links', :js do
context 'nested group project' do context 'nested group project' do
let!(:nested_group) { create(:group, parent: group) } let!(:nested_group) { create(:group, parent: group) }
let!(:another_group) { create(:group) } let!(:another_group) { create(:group) }
let!(:project) { create(:project, namespace: nested_group) } let!(:project) { create(:empty_project, namespace: nested_group) }
background do background do
group.add_master(master) group.add_master(master)
......
...@@ -46,7 +46,7 @@ feature 'Import/Export - project import integration test', js: true do ...@@ -46,7 +46,7 @@ feature 'Import/Export - project import integration test', js: true do
end end
scenario 'invalid project' do scenario 'invalid project' do
project = create(:project, namespace: namespace) project = create(:empty_project, namespace: namespace)
visit new_project_path visit new_project_path
...@@ -62,7 +62,7 @@ feature 'Import/Export - project import integration test', js: true do ...@@ -62,7 +62,7 @@ feature 'Import/Export - project import integration test', js: true do
end end
scenario 'project with no name' do scenario 'project with no name' do
create(:project, namespace: namespace) create(:empty_project, namespace: namespace)
visit new_project_path visit new_project_path
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'issuable templates', js: true do feature 'issuable templates', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
before do before do
project.team << [user, :master] project.team << [user, :master]
...@@ -120,7 +120,7 @@ feature 'issuable templates', js: true do ...@@ -120,7 +120,7 @@ feature 'issuable templates', js: true do
context 'user creates a merge request from a forked project using templates' do context 'user creates a merge request from a forked project using templates' do
let(:template_content) { 'this is a test "feature-proposal" template' } let(:template_content) { 'this is a test "feature-proposal" template' }
let(:fork_user) { create(:user) } let(:fork_user) { create(:user) }
let(:fork_project) { create(:project, :public) } let(:fork_project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, :with_diffs, source_project: fork_project, target_project: project) } let(:merge_request) { create(:merge_request, :with_diffs, source_project: fork_project, target_project: project) }
background do background do
......
...@@ -4,7 +4,7 @@ require 'tempfile' ...@@ -4,7 +4,7 @@ require 'tempfile'
feature 'Jobs' do feature 'Jobs' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user_access_level) { :developer } let(:user_access_level) { :developer }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_pipeline, project: project) } let(:pipeline) { create(:ci_pipeline, project: project) }
let(:job) { create(:ci_build, :trace, pipeline: pipeline) } let(:job) { create(:ci_build, :trace, pipeline: pipeline) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Issue prioritization' do feature 'Issue prioritization' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) }
# Labels # Labels
let(:label_1) { create(:label, title: 'label_1', project: project, priority: 1) } let(:label_1) { create(:label, title: 'label_1', project: project, priority: 1) }
......
...@@ -4,7 +4,7 @@ feature 'Download buttons in project main page' do ...@@ -4,7 +4,7 @@ feature 'Download buttons in project main page' do
given(:user) { create(:user) } given(:user) { create(:user) }
given(:role) { :developer } given(:role) { :developer }
given(:status) { 'success' } given(:status) { 'success' }
given(:project) { create(:project) } given(:project) { create(:project, :repository) }
given(:pipeline) do given(:pipeline) do
create(:ci_pipeline, create(:ci_pipeline,
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Projects > Members > Group member cannot leave group project' do feature 'Projects > Members > Group member cannot leave group project' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:empty_project, namespace: group) }
background do background do
group.add_developer(user) group.add_developer(user)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Projects > Members > Group member cannot request access to his group project' do feature 'Projects > Members > Group member cannot request access to his group project' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:empty_project, namespace: group) }
scenario 'owner does not see the request access button' do scenario 'owner does not see the request access button' do
group.add_owner(user) group.add_owner(user)
......
...@@ -4,7 +4,7 @@ feature 'Projects > Members > Group requester cannot request access to project', ...@@ -4,7 +4,7 @@ feature 'Projects > Members > Group requester cannot request access to project',
let(:user) { create(:user) } let(:user) { create(:user) }
let(:owner) { create(:user) } let(:owner) { create(:user) }
let(:group) { create(:group, :public, :access_requestable) } let(:group) { create(:group, :public, :access_requestable) }
let(:project) { create(:project, :public, :access_requestable, namespace: group) } let(:project) { create(:empty_project, :public, :access_requestable, namespace: group) }
background do background do
group.add_owner(owner) group.add_owner(owner)
......
...@@ -6,7 +6,7 @@ feature 'Project members list' do ...@@ -6,7 +6,7 @@ feature 'Project members list' do
let(:user1) { create(:user, name: 'John Doe') } let(:user1) { create(:user, name: 'John Doe') }
let(:user2) { create(:user, name: 'Mary Jane') } let(:user2) { create(:user, name: 'Mary Jane') }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:empty_project, namespace: group) }
background do background do
sign_in(user1) sign_in(user1)
......
...@@ -5,7 +5,7 @@ feature 'Projects > Members > Master adds member with expiration date', js: true ...@@ -5,7 +5,7 @@ feature 'Projects > Members > Master adds member with expiration date', js: true
include ActiveSupport::Testing::TimeHelpers include ActiveSupport::Testing::TimeHelpers
let(:master) { create(:user) } let(:master) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:empty_project) }
let!(:new_member) { create(:user) } let!(:new_member) { create(:user) }
background do background do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Members > Member cannot request access to his project' do feature 'Projects > Members > Member cannot request access to his project' do
let(:member) { create(:user) } let(:member) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:empty_project) }
background do background do
project.team << [member, :developer] project.team << [member, :developer]
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Members > Member leaves project' do feature 'Projects > Members > Member leaves project' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
background do background do
project.team << [user, :developer] project.team << [user, :developer]
......
require 'spec_helper' require 'spec_helper'
feature 'Projects > Members > Owner cannot leave project' do feature 'Projects > Members > Owner cannot leave project' do
let(:project) { create(:project) } let(:project) { create(:empty_project) }
background do background do
sign_in(project.owner) sign_in(project.owner)
......
require 'spec_helper' require 'spec_helper'
feature 'Projects > Members > Owner cannot request access to his project' do feature 'Projects > Members > Owner cannot request access to his project' do
let(:project) { create(:project) } let(:project) { create(:empty_project) }
background do background do
sign_in(project.owner) sign_in(project.owner)
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Members > User requests access' do feature 'Projects > Members > User requests access' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public, :access_requestable) } let(:project) { create(:project, :public, :access_requestable, :repository) }
let(:master) { project.owner } let(:master) { project.owner }
background do background do
......
...@@ -3,8 +3,8 @@ require 'spec_helper' ...@@ -3,8 +3,8 @@ require 'spec_helper'
feature 'Merge Request button' do feature 'Merge Request button' do
shared_examples 'Merge request button only shown when allowed' do shared_examples 'Merge request button only shown when allowed' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
let(:forked_project) { create(:project, :public, forked_from_project: project) } let(:forked_project) { create(:project, :public, :repository, forked_from_project: project) }
context 'not logged in' do context 'not logged in' do
it 'does not show Create merge request button' do it 'does not show Create merge request button' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Merge Requests List' do feature 'Merge Requests List' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
background do background do
project.team << [user, :developer] project.team << [user, :developer]
......
require 'spec_helper' require 'spec_helper'
feature 'No Password Alert' do feature 'No Password Alert' do
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :repository, namespace: user.namespace) }
context 'with internal auth enabled' do context 'with internal auth enabled' do
before do before do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Pipeline Schedules', :js do feature 'Pipeline Schedules', :js do
include PipelineSchedulesHelper include PipelineSchedulesHelper
let!(:project) { create(:project) } let!(:project) { create(:project, :repository) }
let!(:pipeline_schedule) { create(:ci_pipeline_schedule, :nightly, project: project ) } let!(:pipeline_schedule) { create(:ci_pipeline_schedule, :nightly, project: project ) }
let!(:pipeline) { create(:ci_pipeline, pipeline_schedule: pipeline_schedule) } let!(:pipeline) { create(:ci_pipeline, pipeline_schedule: pipeline_schedule) }
let(:scope) { nil } let(:scope) { nil }
......
...@@ -42,7 +42,7 @@ describe 'Pipeline', :js do ...@@ -42,7 +42,7 @@ describe 'Pipeline', :js do
describe 'GET /:project/pipelines/:id' do describe 'GET /:project/pipelines/:id' do
include_context 'pipeline builds' include_context 'pipeline builds'
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id, user: user) } let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id, user: user) }
before do before do
...@@ -188,7 +188,7 @@ describe 'Pipeline', :js do ...@@ -188,7 +188,7 @@ describe 'Pipeline', :js do
describe 'GET /:project/pipelines/:id/builds' do describe 'GET /:project/pipelines/:id/builds' do
include_context 'pipeline builds' include_context 'pipeline builds'
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) } let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) }
before do before do
...@@ -262,7 +262,7 @@ describe 'Pipeline', :js do ...@@ -262,7 +262,7 @@ describe 'Pipeline', :js do
end end
describe 'GET /:project/pipelines/:id/failures' do describe 'GET /:project/pipelines/:id/failures' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) } let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) }
let(:pipeline_failures_page) { failures_project_pipeline_path(project, pipeline) } let(:pipeline_failures_page) { failures_project_pipeline_path(project, pipeline) }
let!(:failed_build) { create(:ci_build, :failed, pipeline: pipeline) } let!(:failed_build) { create(:ci_build, :failed, pipeline: pipeline) }
......
...@@ -12,7 +12,7 @@ describe 'Pipelines', :js do ...@@ -12,7 +12,7 @@ describe 'Pipelines', :js do
end end
describe 'GET /:project/pipelines' do describe 'GET /:project/pipelines' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let!(:pipeline) do let!(:pipeline) do
create( create(
...@@ -385,7 +385,7 @@ describe 'Pipelines', :js do ...@@ -385,7 +385,7 @@ describe 'Pipelines', :js do
end end
describe 'GET /:project/pipelines/show' do describe 'GET /:project/pipelines/show' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:pipeline) do let(:pipeline) do
create(:ci_empty_pipeline, create(:ci_empty_pipeline,
...@@ -437,7 +437,7 @@ describe 'Pipelines', :js do ...@@ -437,7 +437,7 @@ describe 'Pipelines', :js do
end end
describe 'POST /:project/pipelines' do describe 'POST /:project/pipelines' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
before do before do
visit new_project_pipeline_path(project) visit new_project_pipeline_path(project)
...@@ -476,7 +476,7 @@ describe 'Pipelines', :js do ...@@ -476,7 +476,7 @@ describe 'Pipelines', :js do
end end
describe 'Create pipelines' do describe 'Create pipelines' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
before do before do
visit new_project_pipeline_path(project) visit new_project_pipeline_path(project)
...@@ -512,14 +512,14 @@ describe 'Pipelines', :js do ...@@ -512,14 +512,14 @@ describe 'Pipelines', :js do
end end
context 'when project is public' do context 'when project is public' do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
it { expect(page).to have_content 'Build with confidence' } it { expect(page).to have_content 'Build with confidence' }
it { expect(page).to have_http_status(:success) } it { expect(page).to have_http_status(:success) }
end end
context 'when project is private' do context 'when project is private' do
let(:project) { create(:project, :private) } let(:project) { create(:project, :private, :repository) }
it { expect(page).to have_content 'You need to sign in' } it { expect(page).to have_content 'You need to sign in' }
end end
......
...@@ -55,8 +55,7 @@ describe 'Edit Project Settings' do ...@@ -55,8 +55,7 @@ describe 'Edit Project Settings' do
end end
context 'when changing project path' do context 'when changing project path' do
# Not using empty project because we need a repo to exist let(:project) { create(:project, :repository, namespace: user.namespace, name: 'gitlabhq') }
let(:project) { create(:project, namespace: user.namespace, name: 'gitlabhq') }
before(:context) do before(:context) do
TestEnv.clean_test_path TestEnv.clean_test_path
...@@ -97,8 +96,7 @@ describe 'Edit Project Settings' do ...@@ -97,8 +96,7 @@ describe 'Edit Project Settings' do
end end
describe 'Transfer project section', js: true do describe 'Transfer project section', js: true do
# Not using empty project because we need a repo to exist let!(:project) { create(:project, :repository, namespace: user.namespace, name: 'gitlabhq') }
let!(:project) { create(:project, namespace: user.namespace, name: 'gitlabhq') }
let!(:group) { create(:group) } let!(:group) { create(:group) }
before(:context) do before(:context) do
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Ref switcher', js: true do feature 'Ref switcher', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public, :repository) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Projects > Slack service > Setup events' do feature 'Projects > Slack service > Setup events' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:service) { SlackService.new } let(:service) { SlackService.new }
let(:project) { create(:project, slack_service: service) } let(:project) { create(:empty_project, slack_service: service) }
background do background do
service.fields service.fields
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Slack slash commands' do feature 'Slack slash commands' do
given(:user) { create(:user) } given(:user) { create(:user) }
given(:project) { create(:project) } given(:project) { create(:empty_project) }
given(:service) { project.create_slack_slash_commands_service } given(:service) { project.create_slack_slash_commands_service }
background do background do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Visibility settings', js: true do feature 'Visibility settings', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace, visibility_level: 20) } let(:project) { create(:empty_project, namespace: user.namespace, visibility_level: 20) }
context 'as owner' do context 'as owner' do
before do before do
......
require 'spec_helper' require 'spec_helper'
feature 'Project shortcuts' do feature 'Project shortcuts' do
let(:project) { create(:project, name: 'Victorialand') } let(:project) { create(:empty_project, name: 'Victorialand') }
let(:user) { create(:user) } let(:user) { create(:user) }
describe 'On a project', js: true do describe 'On a project', js: true do
......
...@@ -4,7 +4,7 @@ feature 'Create Snippet', :js do ...@@ -4,7 +4,7 @@ feature 'Create Snippet', :js do
include DropzoneHelper include DropzoneHelper
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository, :public) } let(:project) { create(:empty_project, :public) }
def fill_form def fill_form
fill_in 'project_snippet_title', with: 'My Snippet Title' fill_in 'project_snippet_title', with: 'My Snippet Title'
......
...@@ -7,7 +7,7 @@ describe 'User browses files' do ...@@ -7,7 +7,7 @@ describe 'User browses files' do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
let(:tree_path_ref_6d39438) { project_tree_path(project, '6d39438') } let(:tree_path_ref_6d39438) { project_tree_path(project, '6d39438') }
......
...@@ -5,7 +5,7 @@ feature 'User creates a directory', js: true do ...@@ -5,7 +5,7 @@ feature 'User creates a directory', js: true do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -5,7 +5,7 @@ describe 'User creates files' do ...@@ -5,7 +5,7 @@ describe 'User creates files' do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
......
...@@ -5,7 +5,7 @@ describe 'User deletes files' do ...@@ -5,7 +5,7 @@ describe 'User deletes files' do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
......
...@@ -5,7 +5,7 @@ describe 'User edits files' do ...@@ -5,7 +5,7 @@ describe 'User edits files' do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
......
...@@ -7,7 +7,7 @@ describe 'User replaces files' do ...@@ -7,7 +7,7 @@ describe 'User replaces files' do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
......
...@@ -7,7 +7,7 @@ describe 'User uploads files' do ...@@ -7,7 +7,7 @@ describe 'User uploads files' do
"You're not allowed to make changes to this project directly. "\ "You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request."
end end
let(:project) { create(:project, name: 'Shop') } let(:project) { create(:project, :repository, name: 'Shop') }
let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') } let(:project2) { create(:project, :repository, name: 'Another Project', path: 'another-project') }
let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) } let(:project_tree_path_root_ref) { project_tree_path(project, project.repository.root_ref) }
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) } let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Wiki > User previews markdown changes', js: true do feature 'Projects > Wiki > User previews markdown changes', js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:empty_project, namespace: user.namespace) }
let(:wiki_content) do let(:wiki_content) do
<<-HEREDOC <<-HEREDOC
[regular link](regular) [regular link](regular)
......
...@@ -11,7 +11,7 @@ feature 'Projects > Wiki > User creates wiki page', :js do ...@@ -11,7 +11,7 @@ feature 'Projects > Wiki > User creates wiki page', :js do
end end
context 'in the user namespace' do context 'in the user namespace' do
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:empty_project, namespace: user.namespace) }
context 'when wiki is empty' do context 'when wiki is empty' do
before do before do
...@@ -157,7 +157,7 @@ feature 'Projects > Wiki > User creates wiki page', :js do ...@@ -157,7 +157,7 @@ feature 'Projects > Wiki > User creates wiki page', :js do
end end
context 'in a group namespace' do context 'in a group namespace' do
let(:project) { create(:project, namespace: create(:group, :public)) } let(:project) { create(:empty_project, namespace: create(:group, :public)) }
context 'when wiki is empty' do context 'when wiki is empty' do
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Projects > Wiki > User views Git access wiki page' do describe 'Projects > Wiki > User views Git access wiki page' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:wiki_page) do let(:wiki_page) do
WikiPages::CreateService.new( WikiPages::CreateService.new(
project, project,
......
...@@ -12,7 +12,7 @@ feature 'Projects > Wiki > User updates wiki page' do ...@@ -12,7 +12,7 @@ feature 'Projects > Wiki > User updates wiki page' do
end end
context 'in the user namespace' do context 'in the user namespace' do
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:empty_project, namespace: user.namespace) }
context 'the home page' do context 'the home page' do
scenario 'success when the wiki content is not empty' do scenario 'success when the wiki content is not empty' do
...@@ -64,7 +64,7 @@ feature 'Projects > Wiki > User updates wiki page' do ...@@ -64,7 +64,7 @@ feature 'Projects > Wiki > User updates wiki page' do
end end
context 'in a group namespace' do context 'in a group namespace' do
let(:project) { create(:project, namespace: create(:group, :public)) } let(:project) { create(:empty_project, namespace: create(:group, :public)) }
scenario 'the home page' do scenario 'the home page' do
click_link 'Edit' click_link 'Edit'
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Wiki > User views the wiki page' do feature 'Projects > Wiki > User views the wiki page' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:empty_project, :public) }
let(:old_page_version_id) { wiki_page.versions.last.id } let(:old_page_version_id) { wiki_page.versions.last.id }
let(:wiki_page) do let(:wiki_page) do
WikiPages::CreateService.new( WikiPages::CreateService.new(
......
...@@ -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