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

impersonation_access_token_serializer_spec.rb « serializers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c8cebb94b136ae8b94be3e588fbee1c879bac49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true
require 'spec_helper'

RSpec.describe ImpersonationAccessTokenSerializer do
  subject(:serializer) { described_class.new }

  describe '#represent' do
    it 'can render a single token' do
      token = create(:personal_access_token)

      expect(serializer.represent(token)).to be_kind_of(Hash)
    end

    it 'can render a collection of tokens' do
      tokens = create_list(:personal_access_token, 2)

      expect(serializer.represent(tokens)).to be_kind_of(Array)
    end
  end
end