diff options
Diffstat (limited to 'spec/serializers/personal_access_token_serializer_spec.rb')
-rw-r--r-- | spec/serializers/personal_access_token_serializer_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/serializers/personal_access_token_serializer_spec.rb b/spec/serializers/personal_access_token_serializer_spec.rb new file mode 100644 index 00000000000..e4adc6abccb --- /dev/null +++ b/spec/serializers/personal_access_token_serializer_spec.rb @@ -0,0 +1,21 @@ +# 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 |