Commit 7375c3f4 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ) Committed by David Fernandez

Reuse author variable in mr spec

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 2f199562
......@@ -632,7 +632,7 @@ RSpec.describe Projects::MergeRequestsController do
end
describe 'GET #api_fuzzing_reports' do
let(:merge_request) { create(:ee_merge_request, :with_api_fuzzing_reports, source_project: project, author: create(:user)) }
let_it_be_with_reload(:merge_request) { create(:ee_merge_request, :with_api_fuzzing_reports, source_project: project, author: author) }
let(:params) do
{
......@@ -944,8 +944,8 @@ RSpec.describe Projects::MergeRequestsController do
end
context "when a user is NOT authorized to read licenses on a project" do
let(:project) { create(:project, :repository, :private) }
let(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project, author: create(:user)) }
let_it_be(:project) { create(:project, :repository, :private) }
let_it_be(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project, author: author) }
let(:viewer) { create(:user) }
it 'returns a report' do
......@@ -956,8 +956,8 @@ RSpec.describe Projects::MergeRequestsController do
end
context "when a user is authorized to read the licenses" do
let(:project) { create(:project, :repository, :private) }
let(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project, author: create(:user)) }
let_it_be(:project) { create(:project, :repository, :private) }
let_it_be(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project, author: author) }
let(:viewer) { create(:user) }
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