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>2022-05-19 10:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
commit36a59d088eca61b834191dacea009677a96c052f (patch)
treee4f33972dab5d8ef79e3944a9f403035fceea43f /spec/migrations/toggle_vsa_aggregations_enable_spec.rb
parenta1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff)
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/migrations/toggle_vsa_aggregations_enable_spec.rb')
-rw-r--r--spec/migrations/toggle_vsa_aggregations_enable_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/migrations/toggle_vsa_aggregations_enable_spec.rb b/spec/migrations/toggle_vsa_aggregations_enable_spec.rb
new file mode 100644
index 00000000000..a6850d493b7
--- /dev/null
+++ b/spec/migrations/toggle_vsa_aggregations_enable_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe ToggleVsaAggregationsEnable, :migration do
+ let(:aggregations) { table(:analytics_cycle_analytics_aggregations) }
+ let(:groups) { table(:namespaces) }
+
+ let!(:group1) { groups.create!(name: 'aaa', path: 'aaa') }
+ let!(:group2) { groups.create!(name: 'aaa', path: 'aaa') }
+ let!(:group3) { groups.create!(name: 'aaa', path: 'aaa') }
+
+ let!(:aggregation1) { aggregations.create!(group_id: group1.id, enabled: false) }
+ let!(:aggregation2) { aggregations.create!(group_id: group2.id, enabled: true) }
+ let!(:aggregation3) { aggregations.create!(group_id: group3.id, enabled: false) }
+
+ it 'makes all aggregations enabled' do
+ migrate!
+
+ expect(aggregation1.reload).to be_enabled
+ expect(aggregation2.reload).to be_enabled
+ expect(aggregation3.reload).to be_enabled
+ end
+end