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

tasks_response_spec.rb « conduit « phabricator_import « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4b4c2a6276e22d048ae9ccec74a9f4bada567697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true
require 'spec_helper'

describe Gitlab::PhabricatorImport::Conduit::TasksResponse do
  let(:conduit_response) do
    Gitlab::PhabricatorImport::Conduit::Response
      .new(JSON.parse(fixture_file('phabricator_responses/maniphest.search.json')))
  end

  subject(:response) { described_class.new(conduit_response) }

  describe '#pagination' do
    it 'delegates to the conduit reponse' do
      expect(response.pagination).to eq(conduit_response.pagination)
    end
  end

  describe '#tasks' do
    it 'builds the correct tasks representation' do
      tasks = response.tasks

      titles = tasks.map(&:issue_attributes).map { |attrs| attrs[:title] }

      expect(titles).to contain_exactly('Things are slow', 'Things are broken')
    end
  end
end