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/integrations/integration_list_spec.rb')
-rw-r--r--spec/models/integrations/integration_list_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/integrations/integration_list_spec.rb b/spec/models/integrations/integration_list_spec.rb
new file mode 100644
index 00000000000..b7ccbcecf6b
--- /dev/null
+++ b/spec/models/integrations/integration_list_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Integrations::IntegrationList, feature_category: :integrations do
+ let_it_be(:projects) { create_pair(:project, :small_repo) }
+ let(:batch) { Project.where(id: projects.pluck(:id)) }
+ let(:integration_hash) { { 'active' => 'true', 'category' => 'common' } }
+ let(:association) { 'project' }
+
+ subject { described_class.new(batch, integration_hash, association) }
+
+ describe '#to_array' do
+ it 'returns array of Integration, columns, and values' do
+ expect(subject.to_array).to eq([
+ Integration,
+ %w[active category project_id],
+ [['true', 'common', projects.first.id], ['true', 'common', projects.second.id]]
+ ])
+ end
+ end
+end