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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
764 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe MergeRequestBasicEntity do
2020-11-24 15:15:51 +05:30
let(:resource) { build(:merge_request, params) }
let(:params) { {} }
2020-04-22 19:07:51 +05:30
subject do
described_class.new(resource).as_json
end
it 'has public_merge_status as merge_status' do
expect(resource).to receive(:public_merge_status).and_return('checking')
expect(subject[:merge_status]).to eq 'checking'
end
2020-11-24 15:15:51 +05:30
describe '#reviewers' do
let(:params) { { reviewers: [reviewer] } }
let(:reviewer) { build(:user) }
2021-03-11 19:13:27 +05:30
it 'contains reviewers attributes' do
expect(subject[:reviewers].count).to be 1
expect(subject[:reviewers].first.keys).to include(
:id, :name, :username, :state, :avatar_url, :web_url
)
2020-11-24 15:15:51 +05:30
end
end
2020-04-22 19:07:51 +05:30
end