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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/api/entities/ssh_key_spec.rb')
-rw-r--r--spec/lib/api/entities/ssh_key_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/api/entities/ssh_key_spec.rb b/spec/lib/api/entities/ssh_key_spec.rb
new file mode 100644
index 00000000000..25a0fecfb75
--- /dev/null
+++ b/spec/lib/api/entities/ssh_key_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+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