Commit 5595a0bb authored by Sean Arnold's avatar Sean Arnold

Merge branch '350603-cablett-project-owner-specs-5' into 'master'

Replace owner with first_owner in finder specs

See merge request gitlab-org/gitlab!78855
parents 0e432224 04fb787e
......@@ -3,6 +3,9 @@
require 'spec_helper'
RSpec.describe Autocomplete::UsersFinder do
# TODO update when multiple owners are possible in projects
# https://gitlab.com/gitlab-org/gitlab/-/issues/21432
describe '#execute' do
let!(:user1) { create(:user, username: 'johndoe') }
let!(:user2) { create(:user, :blocked, username: 'notsorandom') }
......@@ -25,19 +28,19 @@ RSpec.describe Autocomplete::UsersFinder do
context 'when project passed' do
let(:project) { create(:project) }
it { is_expected.to match_array([project.owner]) }
it { is_expected.to match_array([project.first_owner]) }
context 'when author_id passed' do
context 'and author is active' do
let(:params) { { author_id: user1.id } }
it { is_expected.to match_array([project.owner, user1]) }
it { is_expected.to match_array([project.first_owner, user1]) }
end
context 'and author is blocked' do
let(:params) { { author_id: user2.id } }
it { is_expected.to match_array([project.owner]) }
it { is_expected.to match_array([project.first_owner]) }
end
end
end
......
......@@ -6,7 +6,7 @@ RSpec.describe Ci::DailyBuildGroupReportResultsFinder do
describe '#execute' do
let_it_be(:project) { create(:project, :private) }
let(:user_without_permission) { create(:user) }
let_it_be(:user_with_permission) { project.owner }
let_it_be(:user_with_permission) { project.first_owner }
let_it_be(:ref_path) { 'refs/heads/master' }
let(:limit) { nil }
let_it_be(:default_branch) { false }
......
......@@ -65,8 +65,8 @@ RSpec.describe MergeRequestTargetProjectFinder do
context 'private projects' do
let(:base_project) { create(:project, :private, path: 'base') }
let(:forked_project) { fork_project(base_project, base_project.owner) }
let(:other_fork) { fork_project(base_project, base_project.owner) }
let(:forked_project) { fork_project(base_project, base_project.first_owner) }
let(:other_fork) { fork_project(base_project, base_project.first_owner) }
context 'when the user is a member of all projects' do
before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment