2019-02-06 07:33:11 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe MergeRequestWidgetCommitEntity do
|
2019-02-06 07:33:11 -05:00
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
let(:commit) { project.commit }
|
|
|
|
let(:request) { double('request') }
|
|
|
|
|
|
|
|
let(:entity) do
|
|
|
|
described_class.new(commit, request: request)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'as json' do
|
|
|
|
subject { entity.as_json }
|
|
|
|
|
|
|
|
it { expect(subject[:message]).to eq(commit.safe_message) }
|
|
|
|
it { expect(subject[:short_id]).to eq(commit.short_id) }
|
|
|
|
it { expect(subject[:title]).to eq(commit.title) }
|
|
|
|
end
|
|
|
|
end
|