Commit 80689309 authored by mo khan's avatar mo khan

Replace usage of `project.users.first` with `viewer`

parent e47a8f3e
......@@ -432,7 +432,7 @@ RSpec.describe Projects::MergeRequestsController do
before do
allow_any_instance_of(::MergeRequest).to receive(:compare_reports)
.with(::Ci::CompareSecurityReportsService, project.users.first, 'dependency_scanning').and_return(comparison_status)
.with(::Ci::CompareSecurityReportsService, viewer, 'dependency_scanning').and_return(comparison_status)
end
context 'when comparison is being processed' do
......@@ -502,7 +502,7 @@ RSpec.describe Projects::MergeRequestsController do
before do
allow_any_instance_of(::MergeRequest).to receive(:compare_reports)
.with(::Ci::CompareSecurityReportsService, project.users.first, 'container_scanning').and_return(comparison_status)
.with(::Ci::CompareSecurityReportsService, viewer, 'container_scanning').and_return(comparison_status)
end
context 'when comparison is being processed' do
......@@ -572,7 +572,7 @@ RSpec.describe Projects::MergeRequestsController do
before do
allow_any_instance_of(::MergeRequest).to receive(:compare_reports)
.with(::Ci::CompareSecurityReportsService, project.users.first, 'sast').and_return(comparison_status)
.with(::Ci::CompareSecurityReportsService, viewer, 'sast').and_return(comparison_status)
end
context 'when comparison is being processed' do
......@@ -643,7 +643,7 @@ RSpec.describe Projects::MergeRequestsController do
before do
allow_any_instance_of(::MergeRequest).to receive(:compare_reports)
.with(::Ci::CompareSecurityReportsService, project.users.first, 'secret_detection').and_return(comparison_status)
.with(::Ci::CompareSecurityReportsService, viewer, 'secret_detection').and_return(comparison_status)
end
context 'when comparison is being processed' do
......@@ -713,7 +713,7 @@ RSpec.describe Projects::MergeRequestsController do
before do
allow_any_instance_of(::MergeRequest).to receive(:compare_reports)
.with(::Ci::CompareSecurityReportsService, project.users.first, 'dast').and_return(comparison_status)
.with(::Ci::CompareSecurityReportsService, viewer, 'dast').and_return(comparison_status)
end
context 'when comparison is being processed' do
......@@ -784,7 +784,7 @@ RSpec.describe Projects::MergeRequestsController do
before do
allow_any_instance_of(::MergeRequest).to receive(:compare_reports)
.with(::Ci::CompareLicenseScanningReportsService, project.users.first).and_return(comparison_status)
.with(::Ci::CompareLicenseScanningReportsService, viewer).and_return(comparison_status)
end
context 'when comparison is being processed' 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