2019-09-30 05:06:31 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-07 08:00:53 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe LfsFileLockEntity do
|
2018-02-07 08:00:53 -05:00
|
|
|
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
|