Commit 8e6dabb0 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rs-empty-project-features' into 'master'

Use `:empty_project` where possible in top-level feature specs

See merge request !10836
parents 7e335d20 aef34502
......@@ -4,7 +4,7 @@ describe 'Auto deploy' do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
before do
project.create_kubernetes_service(
......
......@@ -4,7 +4,7 @@ feature 'Contributions Calendar', :feature, :js do
include WaitForAjax
let(:user) { create(:user) }
let(:contributed_project) { create(:project, :public) }
let(:contributed_project) { create(:empty_project, :public) }
let(:issue_note) { create(:note, project: contributed_project) }
# Ex/ Sunday Jan 1, 2016
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Commits' do
include CiStatusHelper
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
describe 'CI' do
before do
......
......@@ -433,7 +433,7 @@ describe 'Copy as GFM', feature: true, js: true do
end
describe 'Copying code' do
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
context 'from a diff' do
before do
......
......@@ -5,7 +5,7 @@ feature 'Cycle Analytics', feature: true, js: true do
let(:user) { create(:user) }
let(:guest) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
let(:issue) { create(:issue, project: project, created_at: 2.days.ago) }
let(:milestone) { create(:milestone, project: project) }
let(:mr) { create_merge_request_closing_issue(issue) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe "Dashboard Issues filtering", feature: true, js: true do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:empty_project) }
let(:milestone) { create(:milestone, project: project) }
context 'filtering by milestone' do
......
......@@ -4,7 +4,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
include WaitForAjax
let(:branch) { 'expand-collapse-diffs' }
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
before do
login_as :admin
......
require 'spec_helper'
describe "GitLab Flavored Markdown", feature: true do
let(:project) { create(:project) }
let(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:fred) do
u = create(:user, name: "fred")
project.team << [u, :master]
u
create(:user, name: 'fred') do |user|
project.add_master(user)
end
end
before do
allow_any_instance_of(Commit).to receive(:title).
and_return("fix #{issue.to_reference}\n\nask #{fred.to_reference} for details")
login_as(:user)
project.add_developer(@user)
end
describe "for commits" do
let(:project) { create(:project, :repository) }
let(:commit) { project.commit }
before do
login_as :user
project.team << [@user, :developer]
allow_any_instance_of(Commit).to receive(:title).
and_return("fix #{issue.to_reference}\n\nask #{fred.to_reference} for details")
end
describe "for commits" do
it "renders title in commits#index" do
visit namespace_project_commits_path(project.namespace, project, 'master', limit: 1)
......@@ -92,6 +92,8 @@ describe "GitLab Flavored Markdown", feature: true do
end
describe "for merge requests" do
let(:project) { create(:project, :repository) }
before do
@merge_request = create(:merge_request, source_project: project, target_project: project, title: "fix #{issue.to_reference}")
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Global search', feature: true do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:empty_project, namespace: user.namespace) }
before do
project.team << [user, :master]
......
......@@ -6,20 +6,13 @@ describe 'Issues', feature: true do
include SortingHelper
include WaitForAjax
let(:project) { create(:project, :public) }
let(:project) { create(:empty_project, :public) }
before do
login_as :user
user2 = create(:user)
project.team << [[@user, user2], :developer]
project.repository.create_file(
@user,
'.gitlab/issue_templates/bug.md',
'this is a test "bug" template',
message: 'added issue template',
branch_name: 'master')
end
describe 'Edit issue' do
......@@ -378,7 +371,7 @@ describe 'Issues', feature: true do
end
describe 'when I want to reset my incoming email token' do
let(:project1) { create(:project, namespace: @user.namespace) }
let(:project1) { create(:empty_project, namespace: @user.namespace) }
let!(:issue) { create(:issue, project: project1) }
before do
......@@ -610,7 +603,16 @@ describe 'Issues', feature: true do
end
context 'form filled by URL parameters' do
let(:project) { create(:project, :public, :repository) }
before do
project.repository.create_file(
@user,
'.gitlab/issue_templates/bug.md',
'this is a test "bug" template',
message: 'added issue template',
branch_name: 'master')
visit new_namespace_project_issue_path(project.namespace, project, issuable_template: 'bug')
end
......
require 'spec_helper'
feature 'Member autocomplete', :js do
let(:project) { create(:project, :public) }
let(:project) { create(:empty_project, :public) }
let(:user) { create(:user) }
let(:author) { create(:user) }
let(:note) { create(:note, noteable: noteable, project: noteable.project) }
......@@ -36,6 +36,7 @@ feature 'Member autocomplete', :js do
end
context 'adding a new note on a Merge Request' do
let(:project) { create(:project, :public, :repository) }
let(:noteable) do
create(:merge_request, source_project: project,
target_project: project, author: author)
......@@ -48,6 +49,7 @@ feature 'Member autocomplete', :js do
end
context 'adding a new note on a Commit' do
let(:project) { create(:project, :public, :repository) }
let(:noteable) { project.commit }
let(:note) { create(:note_on_commit, project: project, commit_id: project.commit.id) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Project', feature: true do
describe 'description' do
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
let(:path) { namespace_project_path(project.namespace, project) }
before do
......@@ -36,7 +36,7 @@ feature 'Project', feature: true do
describe 'remove forked relationship', js: true do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:empty_project, namespace: user.namespace) }
before do
login_with user
......@@ -57,7 +57,7 @@ feature 'Project', feature: true do
describe 'removal', js: true do
let(:user) { create(:user, username: 'test', name: 'test') }
let(:project) { create(:project, namespace: user.namespace, name: 'project1') }
let(:project) { create(:empty_project, namespace: user.namespace, name: 'project1') }
before do
login_with(user)
......@@ -78,7 +78,7 @@ feature 'Project', feature: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:empty_project, namespace: user.namespace) }
before do
login_with(user)
......@@ -94,8 +94,8 @@ feature 'Project', feature: true do
describe 'project title' do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project2) { create(:project, namespace: user.namespace, path: 'test') }
let(:project) { create(:empty_project, namespace: user.namespace) }
let(:project2) { create(:empty_project, namespace: user.namespace, path: 'test') }
let(:issue) { create(:issue, project: project) }
context 'on issues page', js: true do
......
......@@ -5,7 +5,7 @@ feature 'Projected Branches', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, :admin) }
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
before { login_as(user) }
......
......@@ -5,7 +5,7 @@ feature 'Projected Tags', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, :admin) }
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
before { login_as(user) }
......
......@@ -5,7 +5,7 @@ describe "Search", feature: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:empty_project, namespace: user.namespace) }
let!(:issue) { create(:issue, project: project, assignee: user) }
let!(:issue2) { create(:issue, project: project, author: user) }
......@@ -62,6 +62,7 @@ describe "Search", feature: true do
context 'search for comments' do
context 'when comment belongs to a invalid commit' do
let(:project) { create(:project, :repository) }
let(:note) { create(:note_on_commit, author: user, project: project, commit_id: project.repository.commit.id, note: 'Bug here') }
before { note.update_attributes(commit_id: 12345678) }
......@@ -103,6 +104,7 @@ describe "Search", feature: true do
end
it 'finds a commit' do
project = create(:project, :repository) { |p| p.add_reporter(user) }
visit namespace_project_path(project.namespace, project)
page.within '.search' do
......@@ -116,6 +118,7 @@ describe "Search", feature: true do
end
it 'finds a code' do
project = create(:project, :repository) { |p| p.add_reporter(user) }
visit namespace_project_path(project.namespace, project)
page.within '.search' do
......@@ -222,6 +225,8 @@ describe "Search", feature: true do
end
describe 'search for commits' do
let(:project) { create(:project, :repository) }
before do
visit search_path(project_id: project.id)
end
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Task Lists', feature: true do
include Warden::Test::Helpers
let(:project) { create(:project) }
let(:project) { create(:empty_project) }
let(:user) { create(:user) }
let(:user2) { create(:user) }
......@@ -240,6 +240,7 @@ feature 'Task Lists', feature: true do
end
describe 'multiple tasks' do
let(:project) { create(:project, :repository) }
let!(:merge) { create(:merge_request, :simple, description: markdown, author: user, source_project: project) }
it 'renders for description' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Project variables', js: true do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:empty_project) }
let(:variable) { create(:ci_variable, key: 'test_key', value: 'test value') }
before do
......
......@@ -23,7 +23,7 @@ class MarkdownFeature
# Direct references ----------------------------------------------------------
def project
@project ||= create(:project).tap do |project|
@project ||= create(:project, :repository).tap do |project|
project.team << [user, :master]
end
end
......@@ -80,7 +80,7 @@ class MarkdownFeature
def xproject
@xproject ||= begin
group = create(:group, :nested)
create(:project, namespace: group) do |project|
create(:project, :repository, namespace: group) do |project|
project.team << [user, :developer]
end
end
......
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