gitlab-org--gitlab-foss/spec/serializers/personal_access_token_serializer_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
515 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe PersonalAccessTokenSerializer 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