debian-mirror-gitlab/spec/serializers/impersonation_access_token_serializer_spec.rb
2022-10-11 01:57:18 +05:30

20 lines
519 B
Ruby

# 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