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:
Diffstat (limited to 'spec/models/ci/group_variable_spec.rb')
-rw-r--r--spec/models/ci/group_variable_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/ci/group_variable_spec.rb b/spec/models/ci/group_variable_spec.rb
index 4cb3b9eef0c..3a4b836e453 100644
--- a/spec/models/ci/group_variable_spec.rb
+++ b/spec/models/ci/group_variable_spec.rb
@@ -43,6 +43,14 @@ RSpec.describe Ci::GroupVariable do
end
end
+ describe '.for_groups' do
+ let_it_be(:group) { create(:group) }
+ let_it_be(:group_variable) { create(:ci_group_variable, group: group) }
+ let_it_be(:other_variable) { create(:ci_group_variable) }
+
+ it { expect(described_class.for_groups([group.id])).to eq([group_variable]) }
+ end
+
it_behaves_like 'cleanup by a loose foreign key' do
let!(:model) { create(:ci_group_variable) }