Skip to content

Commit f1766e1

Browse files
Merge pull request #92 from travis-ci/add_received_at_am
[BSFY-112] Add received_at
2 parents a6920dd + ff46fba commit f1766e1

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ end
3434

3535
group :test do
3636
gem 'rack-test'
37+
gem 'timecop'
3738
end

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ GEM
8383
thor (0.20.0)
8484
thread_safe (0.3.6)
8585
tilt (2.0.8)
86+
timecop (0.9.1)
8687
travis-config (1.0.13)
8788
hashr (~> 2.0.0)
8889
tzinfo (1.2.5)
@@ -107,6 +108,7 @@ DEPENDENCIES
107108
sentry-raven
108109
sidekiq (~> 4.0.0)
109110
sinatra (~> 2.0.3)
111+
timecop
110112
travis-config (~> 1.0.0)
111113
travis-support!
112114
yajl-ruby (~> 1.4.0)

lib/travis/listener/app.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def data
178178
:uuid => uuid,
179179
:github_guid => delivery_guid,
180180
:github_event => event_type,
181+
:received_at => Time.now,
181182
}
182183
end
183184

spec/spec_helper.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
c.run_all_when_everything_filtered = true
1919
end
2020

21+
require 'timecop'
22+
Timecop.freeze('2022-01-01 00:02:00 +0200')
23+
2124
module Payloads
2225
def self.load(path)
2326
File.read(File.expand_path("../payloads/#{path}.json", __FILE__))
@@ -28,5 +31,6 @@ def self.load(path)
2831
:type => 'push',
2932
:uuid => Travis.uuid,
3033
:github_guid => 'abc123',
31-
:github_event => 'push'
34+
:github_event => 'push',
35+
:received_at => Time.now
3236
}

0 commit comments

Comments
 (0)