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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/models/analytics/cycle_analytics/aggregation_spec.rb
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/models/analytics/cycle_analytics/aggregation_spec.rb')
-rw-r--r--spec/models/analytics/cycle_analytics/aggregation_spec.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/spec/models/analytics/cycle_analytics/aggregation_spec.rb b/spec/models/analytics/cycle_analytics/aggregation_spec.rb
index 2fb40852791..a51c21dc87e 100644
--- a/spec/models/analytics/cycle_analytics/aggregation_spec.rb
+++ b/spec/models/analytics/cycle_analytics/aggregation_spec.rb
@@ -1,13 +1,13 @@
# frozen_string_literal: true
require 'spec_helper'
-RSpec.describe Analytics::CycleAnalytics::Aggregation, type: :model do
+RSpec.describe Analytics::CycleAnalytics::Aggregation, type: :model, feature_category: :value_stream_management do
describe 'associations' do
- it { is_expected.to belong_to(:group).required }
+ it { is_expected.to belong_to(:namespace).required }
end
describe 'validations' do
- it { is_expected.not_to validate_presence_of(:group) }
+ it { is_expected.not_to validate_presence_of(:namespace) }
it { is_expected.not_to validate_presence_of(:enabled) }
%i[incremental_runtimes_in_seconds incremental_processed_records full_runtimes_in_seconds full_processed_records].each do |column|
@@ -18,6 +18,10 @@ RSpec.describe Analytics::CycleAnalytics::Aggregation, type: :model do
expect(record.errors).to have_key(column)
end
end
+
+ it_behaves_like 'value stream analytics namespace models' do
+ let(:factory_name) { :cycle_analytics_aggregation }
+ end
end
describe 'attribute updater methods' do
@@ -126,19 +130,19 @@ RSpec.describe Analytics::CycleAnalytics::Aggregation, type: :model do
end
end
- describe '#safe_create_for_group' do
+ describe '#safe_create_for_namespace' do
let_it_be(:group) { create(:group) }
let_it_be(:subgroup) { create(:group, parent: group) }
it 'creates the aggregation record' do
- record = described_class.safe_create_for_group(group)
+ record = described_class.safe_create_for_namespace(group)
expect(record).to be_persisted
end
context 'when non top-level group is given' do
it 'creates the aggregation record for the top-level group' do
- record = described_class.safe_create_for_group(subgroup)
+ record = described_class.safe_create_for_namespace(subgroup)
expect(record).to be_persisted
end
@@ -146,11 +150,11 @@ RSpec.describe Analytics::CycleAnalytics::Aggregation, type: :model do
context 'when the record is already present' do
it 'does nothing' do
- described_class.safe_create_for_group(group)
+ described_class.safe_create_for_namespace(group)
expect do
- described_class.safe_create_for_group(group)
- described_class.safe_create_for_group(subgroup)
+ described_class.safe_create_for_namespace(group)
+ described_class.safe_create_for_namespace(subgroup)
end.not_to change { described_class.count }
end
end