debian-mirror-gitlab/spec/serializers/merge_request_user_entity_spec.rb

22 lines
536 B
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
2018-11-08 19:23:39 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe MergeRequestUserEntity do
2018-11-08 19:23:39 +05:30
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
2021-02-22 17:27:13 +05:30
expect(subject).to include(:id, :name, :username, :state, :avatar_url, :web_url, :can_merge)
2018-11-08 19:23:39 +05:30
end
end
end