Welcome to mirror list, hosted at ThFree Co, Russian Federation.

integration_list_spec.rb « integrations « models « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b7ccbcecf6b865ae35f4350e4150312033d7cbfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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