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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e83307bec8f58caaa3b5c7a80325ed2786c9b870
|
4
|
+
data.tar.gz: 74c479c6f4cd6f0df5f2969b995135710cf07e60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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
|
|