2020-05-11 20:10:11 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe API::Entities::DesignManagement::Design do
|
2020-05-11 20:10:11 -04:00
|
|
|
let_it_be(:design) { create(:design) }
|
|
|
|
let(:entity) { described_class.new(design, request: double) }
|
|
|
|
|
|
|
|
subject { entity.as_json }
|
|
|
|
|
|
|
|
it 'has the correct attributes' do
|
|
|
|
expect(subject).to eq({
|
|
|
|
id: design.id,
|
|
|
|
project_id: design.project_id,
|
|
|
|
filename: design.filename,
|
|
|
|
image_url: ::Gitlab::UrlBuilder.build(design)
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|