Commit 75319d97 authored by Robert Speicher's avatar Robert Speicher

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

parent c26f4a07
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)
......
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