Commit 6039a3ed authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-use-timestamp-group-name' into 'master'

Use timestamp in group name in ee_epics_milestone_dates_spec.rb

See merge request gitlab-org/gitlab-ee!8970
parents 1818c1ac 29bed42f
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
describe 'Epics milestone dates API' do describe 'Epics milestone dates API' do
before(:context) do before(:context) do
@api_client = Runtime::API::Client.new(:gitlab) @api_client = Runtime::API::Client.new(:gitlab)
@group_id = create_group @group_id = Resource::Group.fabricate_via_api!.id
@project_id = create_project @project_id = create_project
@milestone_start_date = (Date.today.to_date + 100).strftime("%Y-%m-%d") @milestone_start_date = (Date.today.to_date + 100).strftime("%Y-%m-%d")
@milestone_due_date = (Date.today.to_date + 120).strftime("%Y-%m-%d") @milestone_due_date = (Date.today.to_date + 120).strftime("%Y-%m-%d")
...@@ -26,23 +26,6 @@ module QA ...@@ -26,23 +26,6 @@ module QA
Runtime::API::Request.new(@api_client, api_endpoint) Runtime::API::Request.new(@api_client, api_endpoint)
end end
def create_group(is_sandbox_group = false)
group_name = is_sandbox_group ? Runtime::Namespace.sandbox_name : "group_#{SecureRandom.hex(8)}"
parent_id = is_sandbox_group ? nil : sandbox_group_id
create_group_request = create_request("/groups")
post create_group_request.url, name: group_name, path: group_name, parent_id: parent_id, visibility: 'public'
expect_status(201)
json_body[:id]
end
def sandbox_group_id
@_sandbox_group_id ||= begin
request = create_request("/groups/#{Runtime::Namespace.sandbox_name}")
get request.url
json_body[:id] ? json_body[:id] : create_group(true)
end
end
def create_project def create_project
project_name = "project_#{SecureRandom.hex(8)}" project_name = "project_#{SecureRandom.hex(8)}"
create_project_request = create_request('/projects') create_project_request = create_request('/projects')
......
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