Commit 293ad11d authored by Robert Speicher's avatar Robert Speicher

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

parent 1a0064dc
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) }
......
...@@ -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)}
......
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]
......
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