summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-06-12 16:11:14 -0500
committerMayra Cabrera <mcabrera@gitlab.com>2019-06-25 09:54:47 -0500
commitbde41ee866d0fe0b1bb5ece1130fb6e24d95ad17 (patch)
tree8d52bc34eb73832357142b1cf5cb34a372b27f7f /spec/factories
parentd6c7d4c48db51fdc3eb479e53d40ce4358695218 (diff)
downloadgitlab-ce-bde41ee866d0fe0b1bb5ece1130fb6e24d95ad17.tar.gz
Add two new ActiveRecord models62214-migrations-and-models
- Namespace::Storagestatistics will persist root namespace statistics - Namespace::AggregationSchedule will save information when a new update to the namespace statistics needs to be scheduled Both tables use 'namespace_id' as primary key
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/namespace/aggregation_schedules.rb7
-rw-r--r--spec/factories/namespace/root_storage_statistics.rb7
-rw-r--r--spec/factories/namespaces.rb8
3 files changed, 22 insertions, 0 deletions
diff --git a/spec/factories/namespace/aggregation_schedules.rb b/spec/factories/namespace/aggregation_schedules.rb
new file mode 100644
index 00000000000..c172c3360e2
--- /dev/null
+++ b/spec/factories/namespace/aggregation_schedules.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :namespace_aggregation_schedules, class: Namespace::AggregationSchedule do
+ namespace
+ end
+end
diff --git a/spec/factories/namespace/root_storage_statistics.rb b/spec/factories/namespace/root_storage_statistics.rb
new file mode 100644
index 00000000000..54c5921eb44
--- /dev/null
+++ b/spec/factories/namespace/root_storage_statistics.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :namespace_root_storage_statistics, class: Namespace::RootStorageStatistics do
+ namespace
+ end
+end
diff --git a/spec/factories/namespaces.rb b/spec/factories/namespaces.rb
index 6feafa5ece9..0cfc6e3aa46 100644
--- a/spec/factories/namespaces.rb
+++ b/spec/factories/namespaces.rb
@@ -19,5 +19,13 @@ FactoryBot.define do
owner.namespace = namespace
end
end
+
+ trait :with_aggregation_schedule do
+ association :aggregation_schedule, factory: :namespace_aggregation_schedules
+ end
+
+ trait :with_root_storage_statistics do
+ association :root_storage_statistics, factory: :namespace_root_storage_statistics
+ end
end
end