Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-09-23 10:42:07 +0300
committerJames Lopez <james@jameslopez.es>2016-09-29 17:58:14 +0300
commit29141ed3ea6157a60d9748921782015626a17f9e (patch)
tree7157204905f0184682528735a282cfa7c76f0dfd /spec/factories
parenta8691bda3bb8b2db12f7aabe740a0e064c42fd62 (diff)
fix broken repo 500 errors in UI and added relevant specs
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/projects.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index e61b1fd9647..873d3fcb5af 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -27,6 +27,14 @@ FactoryGirl.define do
end
end
+ trait :broken_repo do
+ after(:create) do |project|
+ project.create_repository
+
+ FileUtils.rm_r(File.join(project.repository_storage_path, "#{project.path_with_namespace}.git", 'refs'))
+ end
+ end
+
# Nest Project Feature attributes
transient do
wiki_access_level ProjectFeature::ENABLED
@@ -56,6 +64,13 @@ FactoryGirl.define do
empty_repo
end
+ # Project with broken repository
+ #
+ # Project with an invalid repository state
+ factory :project_broken_repo, parent: :empty_project do
+ broken_repo
+ end
+
# Project with test repository
#
# Test repository source can be found at