summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-07-21 16:55:17 -0400
committerRobert Speicher <rspeicher@gmail.com>2017-07-27 13:12:15 -0400
commit75319d973b274e071492510688e369e8d3126b43 (patch)
treeeb37221b89a89268c8b6f2ce4b626ddcb90ad485 /spec/features
parentc26f4a07e77786793151bd4ef6063dfcdbb3a808 (diff)
downloadgitlab-ce-75319d973b274e071492510688e369e8d3126b43.tar.gz
Use `empty_project` where possible in spec/features/admin
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/admin/admin_hook_logs_spec.rb2
-rw-r--r--spec/features/admin/admin_hooks_spec.rb2
-rw-r--r--spec/features/admin/admin_projects_spec.rb19
-rw-r--r--spec/features/admin/admin_users_spec.rb2
4 files changed, 14 insertions, 11 deletions
diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb
index 710822ac042..7910d5fb72b 100644
--- a/spec/features/admin/admin_hook_logs_spec.rb
+++ b/spec/features/admin/admin_hook_logs_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
feature 'Admin::HookLogs' do
- let(:project) { create(:project) }
+ let(:project) { create(:empty_project) }
let(:system_hook) { create(:system_hook) }
let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb
index 30fcb334b60..141109fd464 100644
--- a/spec/features/admin/admin_hooks_spec.rb
+++ b/spec/features/admin/admin_hooks_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin::Hooks' do
before do
- @project = create(:project)
+ @project = create(:empty_project)
sign_in(create(:admin))
@system_hook = create(:system_hook)
diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb
index 9856d90bffe..4f69eafcb9d 100644
--- a/spec/features/admin/admin_projects_spec.rb
+++ b/spec/features/admin/admin_projects_spec.rb
@@ -4,17 +4,18 @@ describe "Admin::Projects" do
include Select2Helper
let(:user) { create :user }
- let!(:project) { create(:project) }
- let!(:current_user) { create(:admin) }
+ let(:project) { create(:empty_project) }
+ let(:current_user) { create(:admin) }
before do
sign_in(current_user)
end
describe "GET /admin/projects" do
- let!(:archived_project) { create :project, :public, :archived }
+ let!(:archived_project) { create :empty_project, :public, :archived }
before do
+ expect(project).to be_persisted
visit admin_projects_path
end
@@ -39,15 +40,14 @@ describe "Admin::Projects" do
describe "GET /admin/projects/:namespace_id/:id" do
before do
- visit admin_projects_path
- click_link "#{project.name}"
- end
+ expect(project).to be_persisted
- it do
- expect(current_path).to eq admin_project_path(project)
+ visit admin_projects_path
+ click_link project.name
end
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.name)
expect(page).to have_content(project.name_with_namespace)
@@ -56,6 +56,9 @@ describe "Admin::Projects" do
end
describe 'transfer project' do
+ # The gitlab-shell transfer will fail for a project without a repository
+ let(:project) { create(:project, :repository) }
+
before do
create(:group, name: 'Web')
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index e2e2b13cf8a..0dde8bb696c 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -257,7 +257,7 @@ describe "Admin::Users" do
describe "GET /admin/users/:id/projects" do
let(:group) { create(:group) }
- let!(:project) { create(:project, group: group) }
+ let!(:project) { create(:empty_project, group: group) }
before do
group.add_developer(user)