debian-mirror-gitlab/spec/lib/api/entities/ssh_key_spec.rb
2020-08-09 17:44:08 +05:30

22 lines
512 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe API::Entities::SSHKey do
describe '#as_json' do
subject { entity.as_json }
let(:key) { create(:key, user: create(:user)) }
let(:entity) { described_class.new(key) }
it 'includes basic fields', :aggregate_failures do
is_expected.to include(
id: key.id,
title: key.title,
created_at: key.created_at,
expires_at: key.expires_at,
key: key.publishable_key
)
end
end
end