summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2018-02-07 08:00:53 -0500
committerRubén Dávila <ruben@gitlab.com>2018-02-07 09:04:00 -0500
commitbed948321173b49564f39837e97212ee4dd96e03 (patch)
tree72e6faa9f68378f997f876cf9550561bad546028 /spec/serializers
parentead97c55eac773444dee547a934112aa282c2e2e (diff)
downloadgitlab-ce-bed948321173b49564f39837e97212ee4dd96e03.tar.gz
Backport of LFS File Locking APIrd-35856-backport-lfs-file-locking-api
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/lfs_file_lock_entity_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/serializers/lfs_file_lock_entity_spec.rb b/spec/serializers/lfs_file_lock_entity_spec.rb
new file mode 100644
index 00000000000..5919f473a90
--- /dev/null
+++ b/spec/serializers/lfs_file_lock_entity_spec.rb
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe LfsFileLockEntity do
+ let(:user) { create(:user) }
+ let(:resource) { create(:lfs_file_lock, user: user) }
+
+ let(:request) { double('request', current_user: user) }
+
+ subject { described_class.new(resource, request: request).as_json }
+
+ it 'exposes basic attrs of the lock' do
+ expect(subject).to include(:id, :path, :locked_at)
+ end
+
+ it 'exposes the owner info' do
+ expect(subject).to include(:owner)
+ expect(subject[:owner][:name]).to eq(user.name)
+ end
+end