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
class Renderer::Cron < Renderer::ModelRenderer
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
model.branch.repository

View File

@ -64,7 +64,8 @@ describe Travis::API::V3::Services::Cron::Create do
"name" => "#{branch.name}" },
"interval" => "monthly",
"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

View File

@ -52,7 +52,8 @@ describe Travis::API::V3::Services::Cron::Delete do
"name" => branch.name },
"interval" => "daily",
"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

View File

@ -47,7 +47,8 @@ describe Travis::API::V3::Services::Cron::Find do
"name" => branch.name },
"interval" => "daily",
"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
@ -106,7 +107,8 @@ describe Travis::API::V3::Services::Cron::Find do
"name" => branch.name },
"interval" => "daily",
"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

View File

@ -48,7 +48,8 @@ describe Travis::API::V3::Services::Cron::ForBranch do
"name" => branch.name },
"interval" => "daily",
"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

View File

@ -68,7 +68,8 @@ describe Travis::API::V3::Services::Crons::ForRepository do
"name" => "#{branch.name}" },
"interval" => "daily",
"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')
}
]
}}