Commit 1bda2479 authored by Robert Speicher's avatar Robert Speicher

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

parent c1a27f89
require 'rails_helper'
describe 'Awards Emoji' do
let!(:project) { create(:project, :public) }
let!(:project) { create(:empty_project, :public) }
let!(:user) { create(:user) }
let(:issue) do
create(:issue,
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Issue awards', js: true do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, project: project) }
describe 'logged in' do
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Issues > Labels bulk assignment' do
let(:user) { create(:user) }
let!(:project) { create(:project) }
let!(:project) { create(:empty_project) }
let!(:issue1) { create(:issue, project: project, title: "Issue 1") }
let!(:issue2) { create(:issue, project: project, title: "Issue 2") }
let!(:bug) { create(:label, project: project, title: 'bug') }
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Create Branch/Merge Request Dropdown on issue page', js: true do
let(:user) { create(:user) }
let!(:project) { create(:project) }
let!(:project) { create(:project, :repository) }
let(:issue) { create(:issue, project: project, title: 'Cherry-Coloured Funk') }
context 'for team members' do
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Resolving all open discussions in a merge request from an issue', js: true do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project) }
let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion }
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Resolve an open discussion in a merge request by creating an issue' do
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!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion }
......
......@@ -5,7 +5,7 @@ describe 'Filter issues', js: true do
include FilteredSearchHelpers
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!(:user2) { create(:user, username: 'jane') }
let!(:label) { create(:label, project: project) }
......
......@@ -4,7 +4,7 @@ describe 'New/edit issue', :js do
include ActionView::Helpers::JavaScriptHelper
include FormHelper
let!(:project) { create(:project) }
let!(:project) { create(:empty_project) }
let!(:user) { create(:user)}
let!(:user2) { create(:user)}
let!(:milestone) { create(:milestone, project: project) }
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'GFM autocomplete', js: true do
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(:issue) { create(:issue, project: project) }
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Issue Detail', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, project: project, author: user) }
context 'when user displays the issue' do
......
......@@ -4,7 +4,7 @@ feature 'Issue Sidebar' do
include MobileHelpers
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!(:user) { create(:user)}
let!(:label) { create(:label, project: project, title: 'bug') }
......
require 'rails_helper'
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(:user) { create(:user) }
let(:user) { create(:user) }
before do
sign_in(user)
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'issue move to another project' do
let(:user) { create(:user) }
let(:old_project) { create(:project) }
let(:old_project) { create(:project, :repository) }
let(:text) { 'Some issue description' }
let(:issue) do
......@@ -25,8 +25,8 @@ feature 'issue move to another project' do
context 'user has permission to move issue' do
let!(:mr) { create(:merge_request, source_project: old_project) }
let(:new_project) { create(:project) }
let(:new_project_search) { create(:project) }
let(:new_project) { create(:empty_project) }
let(:new_project_search) { create(:empty_project) }
let(:text) { "Text with #{mr.to_reference}" }
let(:cross_reference) { old_project.to_reference(new_project) }
......@@ -63,8 +63,8 @@ feature 'issue move to another project' do
end
context 'user does not have permission to move the issue to a project', js: true do
let!(:private_project) { create(:project, :private) }
let(:another_project) { create(:project) }
let!(:private_project) { create(:empty_project, :private) }
let(:another_project) { create(:empty_project) }
background { another_project.team << [user, :guest] }
scenario 'browsing projects in projects select' do
......
......@@ -35,42 +35,42 @@ describe 'Create notes on issues', :js do
context 'mentioning issue on a private project' 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) }
end
end
context 'mentioning issue on an internal project' 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) }
end
end
context 'mentioning issue on a public project' 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) }
end
end
context 'mentioning merge request on a private project' 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) }
end
end
context 'mentioning merge request on an internal project' 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) }
end
end
context 'mentioning merge request on a public project' 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) }
end
end
......
......@@ -3,7 +3,7 @@ require 'rails_helper'
describe 'New issue', js: true do
include StubENV
let(:project) { create(:project, :public) }
let(:project) { create(:empty_project, :public) }
let(:user) { create(:user)}
before do
......
require 'rails_helper'
feature 'Manually create a todo item from issue', js: true do
let!(:project) { create(:project) }
let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)}
let!(:project) { create(:empty_project) }
let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)}
before do
project.team << [user, :master]
......
require 'rails_helper'
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!(:user) { create(:user)}
......
......@@ -9,7 +9,7 @@ feature 'Issues > User uses quick actions', js: true do
describe 'issue-only commands' do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:project) { create(:empty_project, :public) }
before do
project.team << [user, :master]
......
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