Commit 416ec57b authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-shl-fix-system-cancels-merge-request-in-merge-trains-spec' into 'master'

Use admin API client for fabricating user

See merge request gitlab-org/gitlab!45739
parents 2c6bce38 5bfe8c2a
......@@ -4,7 +4,7 @@ require 'faker'
module QA
RSpec.describe 'Verify' do
describe 'Merge train', :runner do
describe 'Merge train', :runner, :requires_admin do
let(:file_name) { 'custom_file.txt' }
let(:mr_title) { Faker::Lorem.sentence }
let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(8)}" }
......@@ -47,8 +47,14 @@ module QA
end
end
let(:user) { Resource::User.fabricate_via_api! }
let(:user) do
Resource::User.fabricate_via_api! do |resource|
resource.api_client = admin_api_client
end
end
let(:user_api_client) { Runtime::API::Client.new(:gitlab, user: user) }
let(:admin_api_client) { Runtime::API::Client.as_admin }
let(:merge_request) do
Resource::MergeRequest.fabricate_via_api! do |merge_request|
......
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