summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/phabricator_import/conduit/users_response_spec.rb
blob: 00778ad90fd0721a406c574a3cf61e2d60616634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true
require 'spec_helper'

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

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

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

      usernames = tasks.map(&:username)

      expect(usernames).to contain_exactly('jane', 'john')
    end
  end
end