Skip to content

Commit

Permalink
Add last_seen_at to worker's pusher payload
Browse files Browse the repository at this point in the history
  • Loading branch information
drogus committed Jan 14, 2013
1 parent cdd18fc commit 810fb8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/travis/api/v1/pusher/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module Pusher
class Worker
attr_reader :worker

include Formats

def initialize(worker, options = {})
@worker = worker
end
Expand All @@ -16,7 +18,8 @@ def data
'name' => worker.name,
'state' => worker.state,
'payload' => worker.payload,
'last_error' => worker.last_error
'last_error' => worker.last_error,
'last_seen_at' => format_date(worker.last_seen_at)
}
end
end
Expand Down
5 changes: 3 additions & 2 deletions spec/travis/api/v1/pusher/worker_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe Travis::Api::V1::Pusher::Worker do
include Travis::Testing::Stubs
include Travis::Testing::Stubs, Support::Formats

let(:data) { Travis::Api::V1::Pusher::Worker.new(worker).data }

Expand All @@ -12,7 +12,8 @@
'name' => 'ruby-1',
'state' => 'created',
'last_error' => nil,
'payload' => nil
'payload' => nil,
'last_seen_at' => json_format_time(Time.now.utc)
}
end
end
Expand Down

0 comments on commit 810fb8e

Please sign in to comment.