Merge pull request #266 from HPI-BP2015H/cron-time

return created_at of cron
This commit is contained in:
carlad 2016-06-03 15:37:10 +02:00
commit 9df4dc02cf
6 changed files with 16 additions and 10 deletions

View File

@ -3,7 +3,7 @@ require 'travis/api/v3/renderer/model_renderer'
module Travis::API::V3 module Travis::API::V3
class Renderer::Cron < Renderer::ModelRenderer class Renderer::Cron < Renderer::ModelRenderer
representation(:minimal, :id) representation(:minimal, :id)
representation(:standard, :id, :repository, :branch, :interval, :disable_by_build, :next_enqueuing) representation(:standard, :id, :repository, :branch, :interval, :disable_by_build, :next_enqueuing, :created_at)
def repository def repository
model.branch.repository model.branch.repository

View File

@ -64,7 +64,8 @@ describe Travis::API::V3::Services::Cron::Create do
"name" => "#{branch.name}" }, "name" => "#{branch.name}" },
"interval" => "monthly", "interval" => "monthly",
"disable_by_build" => false, "disable_by_build" => false,
"next_enqueuing" => current_cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ') "next_enqueuing" => current_cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ'),
"created_at" => current_cron.created_at.strftime('%Y-%m-%dT%H:%M:%SZ')
}} }}
end end

View File

@ -52,7 +52,8 @@ describe Travis::API::V3::Services::Cron::Delete do
"name" => branch.name }, "name" => branch.name },
"interval" => "daily", "interval" => "daily",
"disable_by_build" => true, "disable_by_build" => true,
"next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ') "next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ'),
"created_at" => cron.created_at.strftime('%Y-%m-%dT%H:%M:%SZ')
}} }}
end end

View File

@ -46,8 +46,9 @@ describe Travis::API::V3::Services::Cron::Find do
"@representation" => "minimal", "@representation" => "minimal",
"name" => branch.name }, "name" => branch.name },
"interval" => "daily", "interval" => "daily",
"disable_by_build" => true, "disable_by_build" => true,
"next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ') "next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ'),
"created_at" => cron.created_at.strftime('%Y-%m-%dT%H:%M:%SZ')
}} }}
end end
@ -105,8 +106,9 @@ describe Travis::API::V3::Services::Cron::Find do
"@representation" => "minimal", "@representation" => "minimal",
"name" => branch.name }, "name" => branch.name },
"interval" => "daily", "interval" => "daily",
"disable_by_build" => true, "disable_by_build" => true,
"next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ') "next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ'),
"created_at" => cron.created_at.strftime('%Y-%m-%dT%H:%M:%SZ')
}} }}
end end

View File

@ -47,8 +47,9 @@ describe Travis::API::V3::Services::Cron::ForBranch do
"@representation" => "minimal", "@representation" => "minimal",
"name" => branch.name }, "name" => branch.name },
"interval" => "daily", "interval" => "daily",
"disable_by_build" => true, "disable_by_build" => true,
"next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ') "next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ'),
"created_at" => cron.created_at.strftime('%Y-%m-%dT%H:%M:%SZ')
}} }}
end end

View File

@ -68,7 +68,8 @@ describe Travis::API::V3::Services::Crons::ForRepository do
"name" => "#{branch.name}" }, "name" => "#{branch.name}" },
"interval" => "daily", "interval" => "daily",
"disable_by_build" => true, "disable_by_build" => true,
"next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ') "next_enqueuing" => cron.next_enqueuing.strftime('%Y-%m-%dT%H:%M:%SZ'),
"created_at" => cron.created_at.strftime('%Y-%m-%dT%H:%M:%SZ')
} }
] ]
}} }}