2020-08-31 00:10:37 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe MergeRequestReviewer do
|
|
|
|
let(:merge_request) { create(:merge_request) }
|
|
|
|
|
|
|
|
subject { merge_request.merge_request_reviewers.build(reviewer: create(:user)) }
|
|
|
|
|
2021-10-25 09:12:21 +00:00
|
|
|
it_behaves_like 'having unique enum values'
|
|
|
|
|
2021-11-03 06:10:20 +00:00
|
|
|
it_behaves_like 'having reviewer state'
|
|
|
|
|
2020-08-31 00:10:37 +00:00
|
|
|
describe 'associations' do
|
|
|
|
it { is_expected.to belong_to(:merge_request).class_name('MergeRequest') }
|
2020-11-23 18:09:14 +00:00
|
|
|
it { is_expected.to belong_to(:reviewer).class_name('User').inverse_of(:merge_request_reviewers) }
|
2020-08-31 00:10:37 +00:00
|
|
|
end
|
|
|
|
end
|