diff --git a/lib/tasks_private/spec_helper.rake b/lib/tasks_private/spec_helper.rake index e2f54023..48f1fbbd 100644 --- a/lib/tasks_private/spec_helper.rake +++ b/lib/tasks_private/spec_helper.rake @@ -179,11 +179,6 @@ class PopulateTower data = {"name" => 'hello_repo', "scm_url" => "https://github.com/jameswnl/ansible-examples", "scm_type" => "git", "credential" => scm_credential['id'], "organization" => organization['id']} project = create_obj(uri, data) - # create another project - uri = '/api/v1/projects/' - data = {"name" => 'another_repo', "scm_url" => "https://github.com/jameswnl/ansible-examples", "scm_type" => "git", "credential" => scm_credential['id'], "organization" => organization['id']} - create_obj(uri, data) - # create a job_template uri = '/api/v1/job_templates/' data = {"name" => 'hello_template', "description" => "test job", "job_type" => "run", "project" => project['id'], "playbook" => "hello_world.yml", "credential" => machine_credential['id'], "cloud_credential" => aws_credential['id'], "network_credential" => network_credential['id'], "inventory" => inventory['id'], "organization" => organization['id']} @@ -198,6 +193,15 @@ class PopulateTower data = {"name" => "Simple Survey", "description" => "Description of the simple survey", "spec" => [{"type" => "text", "question_name" => "example question", "question_description" => "What is your favorite color?", "variable" => "favorite_color", "required" => false, "default" => "blue"}]} @conn.post(uri, data).body puts "created #{template['url']} survey_spec" + + # create another project + uri = '/api/v1/projects/' + data = {"name" => 'another_repo', "scm_url" => "https://github.com/jameswnl/ansible-examples", "scm_type" => "git", "credential" => scm_credential['id'], "organization" => organization['id']} + another_project = create_obj(uri, data) + + uri = JSON.parse(@conn.get(another_project['url'], data).body)['related']['last_update'] + @conn.delete(uri) + self end