2019-09-30 05:06:31 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-21 08:22:40 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe MergeRequestUserEntity do
|
2018-06-21 08:22:40 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
let(:request) { EntityRequest.new(project: project, current_user: user) }
|
|
|
|
|
|
|
|
let(:entity) do
|
|
|
|
described_class.new(user, request: request)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'as json' do
|
|
|
|
subject { entity.as_json }
|
|
|
|
|
|
|
|
it 'exposes needed attributes' do
|
|
|
|
expect(subject).to include(:can_fork, :can_create_merge_request, :fork_path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|