Skip to content
代码片段 群组 项目
未验证 提交 c4300476 编辑于 作者: Robert May's avatar Robert May 提交者: GitLab
浏览文件

Merge branch 'chore/add-coverage-for-protected_ref-associations' into 'master'

Add test coverage for ProtectedRef associations

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142924



Merged-by: default avatarRobert May <rmay@gitlab.com>
Approved-by: default avatarRobert May <rmay@gitlab.com>
Co-authored-by: default avatarJoe Woodward <j@joewoodward.me>
No related branches found
No related tags found
无相关合并请求
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
let(:user) { create(:user) } let(:user) { create(:user) }
describe 'associations' do describe 'associations' do
it { is_expected.to have_many(:unprotect_access_levels).inverse_of(:protected_branch) }
it { is_expected.to have_many(:required_code_owners_sections).class_name('ProtectedBranch::RequiredCodeOwnersSection') } it { is_expected.to have_many(:required_code_owners_sections).class_name('ProtectedBranch::RequiredCodeOwnersSection') }
it { is_expected.to have_and_belong_to_many(:approval_project_rules) } it { is_expected.to have_and_belong_to_many(:approval_project_rules) }
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
describe 'Associations' do describe 'Associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
it { is_expected.to belong_to(:group) } it { is_expected.to belong_to(:group) }
it { is_expected.to have_many(:merge_access_levels).inverse_of(:protected_branch) }
it { is_expected.to have_many(:push_access_levels).inverse_of(:protected_branch) }
end end
describe 'Validation' do describe 'Validation' do
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
RSpec.describe ProtectedTag, feature_category: :source_code_management do RSpec.describe ProtectedTag, feature_category: :source_code_management do
describe 'Associations' do describe 'Associations' do
it { is_expected.to belong_to(:project).touch(true) } it { is_expected.to belong_to(:project).touch(true) }
it { is_expected.to have_many(:create_access_levels).inverse_of(:protected_tag) }
end end
describe 'Validation' do describe 'Validation' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册