contentful-scheduler-custom-build-john 1.11 → 1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b4f7d1508e849f39446986c62429697d23348b9
4
- data.tar.gz: 13c5b315babe9715dd041a4801a8200957f63f46
3
+ metadata.gz: e83307bec8f58caaa3b5c7a80325ed2786c9b870
4
+ data.tar.gz: 74c479c6f4cd6f0df5f2969b995135710cf07e60
5
5
  SHA512:
6
- metadata.gz: d0f2c744278715c43b4c54b2e54fe094b097a84d0a9688973ec4711c9e120a51f74983cf499e2ccd4e4c28bf5ddc196af2268485f7f07edd244465a33eb8dd30
7
- data.tar.gz: 220558b4febea6f737b85f1c4125d95ae575e720ca7257f315de826ab9443cd5c6e066e748e5a18be9a0f0ba71684cb4a8319e3ee9c2391294c24808275558c3
6
+ metadata.gz: d661f2c6fb9bc5546acb3d32d278e7a434211f41b1c0824d8667c34002089ac32171944be3d3ebb9e2a3dbd262ea97d3e51f5176f7bf3942513ed69728f7fad9
7
+ data.tar.gz: 61e4867c01e33ec98f34f6c1e8ebbfcfc8bff8202e66d312ec83891f16452beb94af79adda9e369f80c39d581196088327837c819bd3df876677a4617c10fc1a
@@ -63,7 +63,7 @@ module Contentful
63
63
 
64
64
  def already_published?(webhook)
65
65
  return true if publish_date(webhook) < Time.now.utc
66
- if !webhook_is_publish_in_future(webhook)
66
+ if !webhook_is_publish_in_future(webhook).nil?
67
67
  return false unless webhook.sys.key?('publishedAt')
68
68
  if !webhook.sys['publishedAt'].nil?
69
69
  return Chronic.parse(webhook.sys['publishedAt']).utc < Time.now.utc
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.11"
3
+ VERSION = "1.12"
4
4
  end
5
5
  end
@@ -104,25 +104,25 @@ describe Contentful::Scheduler::Queue do
104
104
  describe '#already_published?' do
105
105
  it 'true if webhook publish_date is in past' do
106
106
  expect(subject.already_published?(
107
- WebhookDouble.new('bar', 'foo', {}, {'my_field' => '2011-04-04T22:00:00+00:00'})
107
+ WebhookDouble.new('bar', 'foo', {}, {'my_field' => '2011-04-04T22:00:00+00:00', 'is_publish_in_future' => false})
108
108
  )).to be_truthy
109
109
  end
110
110
 
111
111
  it 'true if sys.publishedAt is in past' do
112
112
  expect(subject.already_published?(
113
- WebhookDouble.new('bar', 'foo', {'publishedAt' => '2011-04-04T22:00:00+00:00'}, {'my_field' => '2099-04-04T22:00:00+00:00'})
113
+ WebhookDouble.new('bar', 'foo', {'publishedAt' => '2011-04-04T22:00:00+00:00'}, {'my_field' => '2099-04-04T22:00:00+00:00', 'is_publish_in_future' => false})
114
114
  )).to be_truthy
115
115
  end
116
116
 
117
117
  it 'false if sys.publishedAt is not present' do
118
118
  expect(subject.already_published?(
119
- WebhookDouble.new('bar', 'foo', {}, {'my_field' => '2099-04-04T22:00:00+00:00'})
119
+ WebhookDouble.new('bar', 'foo', {}, {'my_field' => '2099-04-04T22:00:00+00:00', 'is_publish_in_future' => false})
120
120
  )).to be_falsey
121
121
  end
122
122
 
123
123
  it 'false if sys.publishedAt is present but nil' do
124
124
  expect(subject.already_published?(
125
- WebhookDouble.new('bar', 'foo', {'publishedAt' => nil}, {'my_field' => '2099-04-04T22:00:00+00:00'})
125
+ WebhookDouble.new('bar', 'foo', {'publishedAt' => nil}, {'my_field' => '2099-04-04T22:00:00+00:00', 'is_publish_in_future' => false})
126
126
  )).to be_falsey
127
127
  end
128
128
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-scheduler-custom-build-john
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.11'
4
+ version: '1.12'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0