debian-mirror-gitlab/spec/lib/gitlab/phabricator_import/conduit/tasks_response_spec.rb
2019-09-04 21:01:54 +05:30

27 lines
783 B
Ruby

# 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