Commit 1eca7b27 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'sl-qa-staging-63-spam-issue-fix-ee' into 'master'

Fix spam in issue creation by making project private

Closes gitlab-org/quality/staging#63

See merge request gitlab-org/gitlab-ee!14773
parents ea318518 31b3d0ac
...@@ -60,7 +60,7 @@ module QA ...@@ -60,7 +60,7 @@ module QA
end end
def set_visibility(visibility) def set_visibility(visibility)
choose visibility choose visibility.capitalize
end end
def click_github_link def click_github_link
......
...@@ -8,6 +8,7 @@ module QA ...@@ -8,6 +8,7 @@ module QA
include Events::Project include Events::Project
attr_writer :initialize_with_readme attr_writer :initialize_with_readme
attr_writer :visibility
attribute :id attribute :id
attribute :name attribute :name
...@@ -44,6 +45,7 @@ module QA ...@@ -44,6 +45,7 @@ module QA
@standalone = false @standalone = false
@description = 'My awesome project' @description = 'My awesome project'
@initialize_with_readme = false @initialize_with_readme = false
@visibility = 'public'
end end
def name=(raw_name) def name=(raw_name)
...@@ -60,7 +62,7 @@ module QA ...@@ -60,7 +62,7 @@ module QA
page.choose_test_namespace page.choose_test_namespace
page.choose_name(@name) page.choose_name(@name)
page.add_description(@description) page.add_description(@description)
page.set_visibility('Public') page.set_visibility(@visibility)
page.enable_initialize_with_readme if @initialize_with_readme page.enable_initialize_with_readme if @initialize_with_readme
page.create_new_project page.create_new_project
end end
...@@ -88,7 +90,7 @@ module QA ...@@ -88,7 +90,7 @@ module QA
post_body = { post_body = {
name: name, name: name,
description: description, description: description,
visibility: 'public', visibility: @visibility,
initialize_with_readme: @initialize_with_readme initialize_with_readme: @initialize_with_readme
} }
......
...@@ -96,7 +96,14 @@ module QA ...@@ -96,7 +96,14 @@ module QA
end end
def create_issue_resource def create_issue_resource
project = Resource::Project.fabricate_via_api! do |project|
project.name = 'project-for-issues'
project.description = 'project for adding issues'
project.visibility = 'private'
end
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api! do |issue|
issue.project = project
issue.title = 'Issue created via API' issue.title = 'Issue created via API'
end end
end end
......
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