diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-06-12 16:11:14 -0500 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-06-25 09:54:47 -0500 |
commit | bde41ee866d0fe0b1bb5ece1130fb6e24d95ad17 (patch) | |
tree | 8d52bc34eb73832357142b1cf5cb34a372b27f7f /spec/models/namespace | |
parent | d6c7d4c48db51fdc3eb479e53d40ce4358695218 (diff) | |
download | gitlab-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/models/namespace')
-rw-r--r-- | spec/models/namespace/aggregation_schedule_spec.rb | 7 | ||||
-rw-r--r-- | spec/models/namespace/root_storage_statistics_spec.rb | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/namespace/aggregation_schedule_spec.rb b/spec/models/namespace/aggregation_schedule_spec.rb new file mode 100644 index 00000000000..5ba7547ff4d --- /dev/null +++ b/spec/models/namespace/aggregation_schedule_spec.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Namespace::AggregationSchedule, type: :model do + it { is_expected.to belong_to :namespace } +end diff --git a/spec/models/namespace/root_storage_statistics_spec.rb b/spec/models/namespace/root_storage_statistics_spec.rb new file mode 100644 index 00000000000..f6fb5af5aae --- /dev/null +++ b/spec/models/namespace/root_storage_statistics_spec.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Namespace::RootStorageStatistics, type: :model do + it { is_expected.to belong_to :namespace } + it { is_expected.to have_one(:route).through(:namespace) } + + it { is_expected.to delegate_method(:all_projects).to(:namespace) } +end |