Commit dc92da09 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'ml-restore-use-of-reusable-project-and-fix-project-token-issue' into 'master'

Let GitLab remove token with project after test

See merge request gitlab-org/gitlab!78852
parents 890c20bb 93f779ec
...@@ -9,9 +9,7 @@ module QA ...@@ -9,9 +9,7 @@ module QA
attribute :id attribute :id
attribute :project do attribute :project do
Project.fabricate! do |project| Project.fabricate!
project.initialize_with_readme = true
end
end end
attribute :token do attribute :token do
Page::Project::Settings::AccessTokens.perform(&:created_access_token) Page::Project::Settings::AccessTokens.perform(&:created_access_token)
......
...@@ -4,7 +4,9 @@ module QA ...@@ -4,7 +4,9 @@ module QA
RSpec.describe 'Manage' do RSpec.describe 'Manage' do
describe 'Project access token' do describe 'Project access token' do
before(:all) do before(:all) do
@project_access_token = QA::Resource::ProjectAccessToken.fabricate_via_api! @project_access_token = QA::Resource::ProjectAccessToken.fabricate_via_api! do |pat|
pat.project = Resource::ReusableProject.fabricate_via_api!
end
@user_api_client = Runtime::API::Client.new(:gitlab, personal_access_token: @project_access_token.token) @user_api_client = Runtime::API::Client.new(:gitlab, personal_access_token: @project_access_token.token)
end end
...@@ -76,11 +78,6 @@ module QA ...@@ -76,11 +78,6 @@ module QA
@different_project.remove_via_api! @different_project.remove_via_api!
end end
end end
after(:all) do
@project_access_token.remove_via_api!
@project_access_token.project.remove_via_api!
end
end end
end end
end end
...@@ -11,12 +11,7 @@ module QA ...@@ -11,12 +11,7 @@ module QA
let(:title) { "MR push options test #{SecureRandom.hex(8)}" } let(:title) { "MR push options test #{SecureRandom.hex(8)}" }
let(:commit_message) { 'Add README.md' } let(:commit_message) { 'Add README.md' }
let(:project) do let(:project) { Resource::ReusableProject.fabricate_via_api! }
Resource::Project.fabricate_via_api! do |project|
project.name = 'merge-request-push-options'
project.initialize_with_readme = true
end
end
def create_new_mr_via_push def create_new_mr_via_push
Resource::Repository::ProjectPush.fabricate! do |push| Resource::Repository::ProjectPush.fabricate! do |push|
......
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