active_encode 0.5.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +80 -0
  3. data/.rubocop.yml +9 -70
  4. data/.rubocop_todo.yml +68 -0
  5. data/Gemfile +5 -4
  6. data/README.md +69 -0
  7. data/active_encode.gemspec +12 -3
  8. data/app/controllers/active_encode/encode_record_controller.rb +1 -0
  9. data/app/jobs/active_encode/polling_job.rb +1 -1
  10. data/app/models/active_encode/encode_record.rb +1 -0
  11. data/db/migrate/20180822021048_create_active_encode_encode_records.rb +1 -0
  12. data/db/migrate/20190702153755_add_create_options_to_active_encode_encode_records.rb +6 -0
  13. data/db/migrate/20190712174821_add_progress_to_active_encode_encode_records.rb +6 -0
  14. data/lib/active_encode.rb +1 -0
  15. data/lib/active_encode/base.rb +2 -2
  16. data/lib/active_encode/callbacks.rb +1 -0
  17. data/lib/active_encode/core.rb +4 -3
  18. data/lib/active_encode/engine.rb +1 -0
  19. data/lib/active_encode/engine_adapter.rb +1 -0
  20. data/lib/active_encode/engine_adapters.rb +4 -1
  21. data/lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb +31 -29
  22. data/lib/active_encode/engine_adapters/ffmpeg_adapter.rb +138 -87
  23. data/lib/active_encode/engine_adapters/matterhorn_adapter.rb +5 -4
  24. data/lib/active_encode/engine_adapters/media_convert_adapter.rb +399 -0
  25. data/lib/active_encode/engine_adapters/media_convert_output.rb +104 -0
  26. data/lib/active_encode/engine_adapters/pass_through_adapter.rb +239 -0
  27. data/lib/active_encode/engine_adapters/test_adapter.rb +5 -4
  28. data/lib/active_encode/engine_adapters/zencoder_adapter.rb +3 -2
  29. data/lib/active_encode/errors.rb +6 -0
  30. data/lib/active_encode/global_id.rb +2 -1
  31. data/lib/active_encode/input.rb +3 -2
  32. data/lib/active_encode/output.rb +3 -2
  33. data/lib/active_encode/persistence.rb +11 -5
  34. data/lib/active_encode/polling.rb +3 -2
  35. data/lib/active_encode/spec/shared_specs.rb +2 -0
  36. data/{spec/shared_specs/engine_adapter_specs.rb → lib/active_encode/spec/shared_specs/engine_adapter.rb} +37 -38
  37. data/lib/active_encode/status.rb +1 -0
  38. data/lib/active_encode/technical_metadata.rb +3 -2
  39. data/lib/active_encode/version.rb +2 -1
  40. data/lib/file_locator.rb +8 -9
  41. data/spec/controllers/encode_record_controller_spec.rb +4 -3
  42. data/spec/fixtures/ffmpeg/cancelled-id/cancelled +0 -0
  43. data/spec/fixtures/file with space.low.mp4 +0 -0
  44. data/spec/fixtures/file with space.mp4 +0 -0
  45. data/spec/fixtures/fireworks.low.mp4 +0 -0
  46. data/spec/fixtures/media_convert/endpoints.json +1 -0
  47. data/spec/fixtures/media_convert/job_canceled.json +412 -0
  48. data/spec/fixtures/media_convert/job_canceling.json +1 -0
  49. data/spec/fixtures/media_convert/job_completed.json +359 -0
  50. data/spec/fixtures/media_convert/job_completed_detail.json +1 -0
  51. data/spec/fixtures/media_convert/job_completed_detail_query.json +1 -0
  52. data/spec/fixtures/media_convert/job_completed_empty_detail.json +1 -0
  53. data/spec/fixtures/media_convert/job_created.json +408 -0
  54. data/spec/fixtures/media_convert/job_failed.json +406 -0
  55. data/spec/fixtures/media_convert/job_progressing.json +414 -0
  56. data/spec/fixtures/pass_through/cancelled-id/cancelled +0 -0
  57. data/spec/fixtures/pass_through/cancelled-id/input_metadata +90 -0
  58. data/spec/fixtures/pass_through/completed-id/completed +0 -0
  59. data/spec/fixtures/pass_through/completed-id/input_metadata +102 -0
  60. data/spec/fixtures/pass_through/completed-id/output_metadata-high +90 -0
  61. data/spec/fixtures/pass_through/completed-id/output_metadata-low +90 -0
  62. data/spec/fixtures/pass_through/completed-id/video-high.mp4 +0 -0
  63. data/spec/fixtures/pass_through/completed-id/video-low.mp4 +0 -0
  64. data/spec/fixtures/pass_through/failed-id/error.log +1 -0
  65. data/spec/fixtures/pass_through/failed-id/input_metadata +90 -0
  66. data/spec/fixtures/pass_through/running-id/input_metadata +90 -0
  67. data/spec/integration/elastic_transcoder_adapter_spec.rb +30 -30
  68. data/spec/integration/ffmpeg_adapter_spec.rb +93 -25
  69. data/spec/integration/matterhorn_adapter_spec.rb +45 -44
  70. data/spec/integration/media_convert_adapter_spec.rb +152 -0
  71. data/spec/integration/pass_through_adapter_spec.rb +151 -0
  72. data/spec/integration/zencoder_adapter_spec.rb +210 -209
  73. data/spec/rails_helper.rb +1 -0
  74. data/spec/routing/encode_record_controller_routing_spec.rb +1 -0
  75. data/spec/spec_helper.rb +2 -2
  76. data/spec/test_app_templates/lib/generators/test_app_generator.rb +13 -12
  77. data/spec/units/callbacks_spec.rb +3 -2
  78. data/spec/units/core_spec.rb +26 -25
  79. data/spec/units/engine_adapter_spec.rb +1 -0
  80. data/spec/units/file_locator_spec.rb +20 -19
  81. data/spec/units/global_id_spec.rb +12 -11
  82. data/spec/units/input_spec.rb +8 -5
  83. data/spec/units/output_spec.rb +8 -5
  84. data/spec/units/persistence_spec.rb +15 -11
  85. data/spec/units/polling_job_spec.rb +7 -6
  86. data/spec/units/polling_spec.rb +1 -0
  87. data/spec/units/status_spec.rb +3 -3
  88. metadata +158 -14
  89. data/.travis.yml +0 -19
data/spec/rails_helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  require 'engine_cart'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rails_helper'
2
3
 
3
4
  describe ActiveEncode::EncodeRecordController, type: :routing do
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'coveralls'
2
3
  Coveralls.wear!
3
4
 
@@ -5,7 +6,6 @@ require 'bundler/setup'
5
6
  Bundler.setup
6
7
 
7
8
  require 'byebug'
8
- require 'rspec/its'
9
9
  require 'active_encode'
10
10
 
11
11
  RSpec.configure do |_config|
@@ -13,6 +13,6 @@ end
13
13
 
14
14
  RSpec::Matchers.define :be_the_same_time_as do |expected|
15
15
  match do |actual|
16
- expect(Time.parse(expected)).to eq(Time.parse(actual))
16
+ expect(Time.parse(expected).utc).to eq(Time.parse(actual).utc)
17
17
  end
18
18
  end
@@ -1,15 +1,16 @@
1
- require 'rails/generators'
1
+ # frozen_string_literal: true
2
+ # frozen_string_literal: true
3
+ require 'rails/generators'
2
4
 
3
- class TestAppGenerator < Rails::Generators::Base
4
- source_root "./spec/test_app_templates"
5
+ class TestAppGenerator < Rails::Generators::Base
6
+ source_root "./spec/test_app_templates"
5
7
 
6
- # if you need to generate any additional configuration
7
- # into the test app, this generator will be run immediately
8
- # after setting up the application
9
-
10
- def install_engine
11
- generate 'active_encode:install'
12
- rake 'active_encode:install:migrations'
13
- end
14
- end
8
+ # if you need to generate any additional configuration
9
+ # into the test app, this generator will be run immediately
10
+ # after setting up the application
15
11
 
12
+ def install_engine
13
+ generate 'active_encode:install'
14
+ rake 'active_encode:install:migrations'
15
+ end
16
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe ActiveEncode::Callbacks do
@@ -36,14 +37,14 @@ describe ActiveEncode::Callbacks do
36
37
  end
37
38
 
38
39
  describe 'find callback' do
39
- let(:encode) { CallbackEncode.create("sample.mp4") }
40
40
  subject { CallbackEncode.find(encode.id).history }
41
+ let(:encode) { CallbackEncode.create("sample.mp4") }
41
42
  it { is_expected.to include("CallbackEncode ran after_find") }
42
43
  end
43
44
 
44
45
  describe 'reload callback' do
45
- let(:encode) { CallbackEncode.create("sample.mp4") }
46
46
  subject { encode.reload.history }
47
+ let(:encode) { CallbackEncode.create("sample.mp4") }
47
48
  it { is_expected.to include("CallbackEncode ran after_reload") }
48
49
  end
49
50
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe ActiveEncode::Core do
@@ -5,7 +6,7 @@ describe ActiveEncode::Core do
5
6
  class CustomEncode < ActiveEncode::Base
6
7
  end
7
8
  end
8
- after do
9
+ after do
9
10
  Object.send(:remove_const, :CustomEncode)
10
11
  end
11
12
 
@@ -24,11 +25,11 @@ describe ActiveEncode::Core do
24
25
  end
25
26
 
26
27
  describe 'find' do
27
- let(:id) { encode_class.create(nil).id }
28
28
  subject { encode_class.find(id) }
29
+ let(:id) { encode_class.create(nil).id }
29
30
 
30
31
  it { is_expected.to be_a encode_class }
31
- its(:id) { is_expected.to eq id }
32
+ it { expect(subject.id).to eq id }
32
33
 
33
34
  context 'with no id' do
34
35
  let(:id) { nil }
@@ -42,13 +43,13 @@ describe ActiveEncode::Core do
42
43
  let(:encode_class) { CustomEncode }
43
44
 
44
45
  it { is_expected.to be_a encode_class }
45
- its(:id) { is_expected.to eq id }
46
+ it { expect(subject.id).to eq id }
46
47
 
47
48
  context 'casting' do
48
49
  let(:id) { ActiveEncode::Base.create(nil).id }
49
50
 
50
51
  it { is_expected.to be_a encode_class }
51
- its(:id) { is_expected.to eq id }
52
+ it { expect(subject.id).to eq id }
52
53
  end
53
54
  end
54
55
  end
@@ -57,44 +58,44 @@ describe ActiveEncode::Core do
57
58
  subject { encode_class.create(nil) }
58
59
 
59
60
  it { is_expected.to be_a encode_class }
60
- its(:id) { is_expected.not_to be nil }
61
- its(:state) { is_expected.not_to be nil }
61
+ it { expect(subject.id).not_to be nil }
62
+ it { expect(subject.state).not_to be nil }
62
63
 
63
64
  context 'with an ActiveEncode::Base subclass' do
64
65
  let(:encode_class) { CustomEncode }
65
66
 
66
67
  it { is_expected.to be_a encode_class }
67
- its(:id) { is_expected.not_to be nil }
68
- its(:state) { is_expected.not_to be nil }
68
+ it { expect(subject.id).not_to be nil }
69
+ it { expect(subject.state).not_to be nil }
69
70
  end
70
71
  end
71
72
 
72
73
  describe '#create!' do
73
- let(:encode) { encode_class.new(nil) }
74
74
  subject { encode.create! }
75
+ let(:encode) { encode_class.new(nil) }
75
76
 
76
77
  it { is_expected.to equal encode }
77
78
  it { is_expected.to be_a encode_class }
78
- its(:id) { is_expected.not_to be nil }
79
- its(:state) { is_expected.not_to be nil }
79
+ it { expect(subject.id).not_to be nil }
80
+ it { expect(subject.state).not_to be nil }
80
81
 
81
82
  context 'with an ActiveEncode::Base subclass' do
82
83
  let(:encode_class) { CustomEncode }
83
84
 
84
85
  it { is_expected.to equal encode }
85
86
  it { is_expected.to be_a encode_class }
86
- its(:id) { is_expected.not_to be nil }
87
- its(:state) { is_expected.not_to be nil }
87
+ it { expect(subject.id).not_to be nil }
88
+ it { expect(subject.state).not_to be nil }
88
89
  end
89
90
  end
90
91
 
91
92
  describe '#cancel!' do
92
- let(:encode) { encode_class.create(nil) }
93
93
  subject { encode.cancel! }
94
+ let(:encode) { encode_class.create(nil) }
94
95
 
95
96
  it { is_expected.to equal encode }
96
97
  it { is_expected.to be_a encode_class }
97
- its(:id) { is_expected.not_to be nil }
98
+ it { expect(subject.id).not_to be nil }
98
99
  it { is_expected.to be_cancelled }
99
100
 
100
101
  context 'with an ActiveEncode::Base subclass' do
@@ -102,27 +103,27 @@ describe ActiveEncode::Core do
102
103
 
103
104
  it { is_expected.to equal encode }
104
105
  it { is_expected.to be_a encode_class }
105
- its(:id) { is_expected.not_to be nil }
106
+ it { expect(subject.id).not_to be nil }
106
107
  it { is_expected.to be_cancelled }
107
108
  end
108
109
  end
109
110
 
110
111
  describe '#reload' do
111
- let(:encode) { encode_class.create(nil) }
112
112
  subject { encode.reload }
113
+ let(:encode) { encode_class.create(nil) }
113
114
 
114
115
  it { is_expected.to equal encode }
115
116
  it { is_expected.to be_a encode_class }
116
- its(:id) { is_expected.not_to be nil }
117
- its(:state) { is_expected.not_to be nil }
117
+ it { expect(subject.id).not_to be nil }
118
+ it { expect(subject.state).not_to be nil }
118
119
 
119
120
  context 'with an ActiveEncode::Base subclass' do
120
121
  let(:encode_class) { CustomEncode }
121
122
 
122
123
  it { is_expected.to equal encode }
123
124
  it { is_expected.to be_a encode_class }
124
- its(:id) { is_expected.not_to be nil }
125
- its(:state) { is_expected.not_to be nil }
125
+ it { expect(subject.id).not_to be nil }
126
+ it { expect(subject.state).not_to be nil }
126
127
  end
127
128
  end
128
129
 
@@ -134,15 +135,15 @@ describe ActiveEncode::Core do
134
135
  end
135
136
  end
136
137
  end
137
- after do
138
+ after do
138
139
  Object.send(:remove_const, :DefaultOptionsEncode)
139
140
  end
140
141
 
142
+ subject { encode.options }
141
143
  let(:encode_class) { DefaultOptionsEncode }
142
144
  let(:default_options) { { preset: 'video' } }
143
- let(:options) { { output: [{label: 'high', ffmpeg_opt: "640x480" }] } }
145
+ let(:options) { { output: [{ label: 'high', ffmpeg_opt: "640x480" }] } }
144
146
  let(:encode) { encode_class.new(nil, options) }
145
- subject { encode.options }
146
147
 
147
148
  it 'merges default options and options parameter' do
148
149
  expect(subject).to include default_options
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe ActiveEncode::EngineAdapter do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Copyright 2011-2018, The Trustees of Indiana University and Northwestern
2
3
  # University. Licensed under the Apache License, Version 2.0 (the "License");
3
4
  # you may not use this file except in compliance with the License.
@@ -11,7 +12,7 @@
11
12
  # CONDITIONS OF ANY KIND, either express or implied. See the License for the
12
13
  # specific language governing permissions and limitations under the License.
13
14
  # --- END LICENSE_HEADER BLOCK ---
14
- require 'aws-sdk'
15
+ require 'aws-sdk-s3'
15
16
  require 'rails_helper'
16
17
 
17
18
  describe FileLocator, type: :service do
@@ -24,12 +25,12 @@ describe FileLocator, type: :service do
24
25
  let(:key) { "mykey.mp4" }
25
26
  let(:s3file) { FileLocator::S3File.new("s3://#{bucket}/#{key}") }
26
27
 
27
- it "should be able to initialize from an S3 URI" do
28
+ it "is able to initialize from an S3 URI" do
28
29
  expect(s3file.bucket).to eq bucket
29
30
  expect(s3file.key).to eq key
30
31
  end
31
32
 
32
- it "should return an S3 Object" do
33
+ it "returns an S3 Object" do
33
34
  s3_object = s3file.object
34
35
  expect(s3_object).to be_an Aws::S3::Object
35
36
  expect(s3_object.bucket_name).to eq bucket
@@ -42,30 +43,30 @@ describe FileLocator, type: :service do
42
43
  let(:source) { "file://#{path}" }
43
44
  let(:locator) { FileLocator.new(source) }
44
45
 
45
- it "should return the correct uri" do
46
+ it "returns the correct uri" do
46
47
  expect(locator.uri).to eq Addressable::URI.parse(source)
47
48
  end
48
49
 
49
- it "should return the correct location" do
50
+ it "returns the correct location" do
50
51
  expect(locator.location).to eq path
51
52
  end
52
53
 
53
- it "should tell if file exists" do
54
+ it "tells if file exists" do
54
55
  allow(File).to receive(:exist?).with(path) { true }
55
56
  expect(locator.exist?).to be_truthy
56
57
  end
57
58
 
58
59
  context "return file" do
59
60
  let(:file) { double(File) }
60
- before :each do
61
+ before do
61
62
  allow(File).to receive(:open).and_return file
62
63
  end
63
64
 
64
- it "should return reader" do
65
+ it "returns reader" do
65
66
  expect(locator.reader).to eq file
66
67
  end
67
68
 
68
- it "should return attachment" do
69
+ it "returns attachment" do
69
70
  expect(locator.attachment).to eq file
70
71
  end
71
72
  end
@@ -77,23 +78,23 @@ describe FileLocator, type: :service do
77
78
  let(:source) { "s3://#{bucket}/#{key}" }
78
79
  let(:locator) { FileLocator.new(source) }
79
80
 
80
- it "should return the correct uri" do
81
+ it "returns the correct uri" do
81
82
  expect(locator.uri).to eq Addressable::URI.parse(source)
82
83
  end
83
84
 
84
- it "should return the correct location" do
85
+ it "returns the correct location" do
85
86
  expect(locator.location).to start_with "https://#{bucket}.s3.us-stubbed-1.amazonaws.com/#{key}"
86
87
  end
87
88
 
88
- it "should tell if file exists" do
89
+ it "tells if file exists" do
89
90
  expect(locator.exist?).to be_truthy
90
91
  end
91
92
 
92
- it "should return reader" do
93
+ it "returns reader" do
93
94
  expect(locator.reader).to be_a StringIO
94
95
  end
95
96
 
96
- it "should return attachment" do
97
+ it "returns attachment" do
97
98
  expect(locator.attachment).to eq Addressable::URI.parse(source)
98
99
  end
99
100
  end
@@ -103,25 +104,25 @@ describe FileLocator, type: :service do
103
104
  let(:source) { "bogus://#{path}" }
104
105
  let(:locator) { FileLocator.new(source) }
105
106
 
106
- it "should return the correct uri" do
107
+ it "returns the correct uri" do
107
108
  expect(locator.uri).to eq Addressable::URI.parse(source)
108
109
  end
109
110
 
110
- it "should return the correct location" do
111
+ it "returns the correct location" do
111
112
  expect(locator.location).to eq source
112
113
  end
113
114
 
114
- it "should tell if file exists" do
115
+ it "tells if file exists" do
115
116
  expect(locator.exist?).to be_falsy
116
117
  end
117
118
 
118
- it "should return reader" do
119
+ it "returns reader" do
119
120
  io = double(IO)
120
121
  allow(Kernel).to receive(:open).and_return io
121
122
  expect(locator.reader).to eq io
122
123
  end
123
124
 
124
- it "should return attachment" do
125
+ it "returns attachment" do
125
126
  expect(locator.attachment).to eq locator.location
126
127
  end
127
128
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe ActiveEncode::GlobalID do
@@ -11,39 +12,39 @@ describe ActiveEncode::GlobalID do
11
12
  end
12
13
 
13
14
  describe '#to_global_id' do
15
+ subject { encode.to_global_id }
14
16
  let(:encode_class) { ActiveEncode::Base }
15
17
  let(:encode) { encode_class.create(nil) }
16
- subject { encode.to_global_id }
17
18
 
18
19
  it { is_expected.to be_a GlobalID }
19
- its(:model_class) { is_expected.to eq encode_class }
20
- its(:model_id) { is_expected.to eq encode.id }
21
- its(:app) { is_expected.to eq 'ActiveEncode' }
20
+ it { expect(subject.model_class).to eq encode_class }
21
+ it { expect(subject.model_id).to eq encode.id }
22
+ it { expect(subject.app).to eq 'ActiveEncode' }
22
23
 
23
24
  context 'with an ActiveEncode::Base subclass' do
24
25
  let(:encode_class) { CustomEncode }
25
26
 
26
27
  it { is_expected.to be_a GlobalID }
27
- its(:model_class) { is_expected.to eq encode_class }
28
- its(:model_id) { is_expected.to eq encode.id }
29
- its(:app) { is_expected.to eq 'ActiveEncode' }
28
+ it { expect(subject.model_class).to eq encode_class }
29
+ it { expect(subject.model_id).to eq encode.id }
30
+ it { expect(subject.app).to eq 'ActiveEncode' }
30
31
  end
31
32
  end
32
33
 
33
34
  describe 'GlobalID::Locator#locate' do
35
+ subject { GlobalID::Locator.locate(global_id) }
34
36
  let(:encode_class) { ActiveEncode::Base }
35
37
  let(:encode) { encode_class.create(nil) }
36
38
  let(:global_id) { encode.to_global_id }
37
- subject { GlobalID::Locator.locate(global_id) }
38
39
 
39
40
  it { is_expected.to be_a encode_class }
40
- its(:id) { is_expected.to eq encode.id }
41
+ it { expect(subject.id).to eq encode.id }
41
42
 
42
43
  context 'with an ActiveEncode::Base subclass' do
43
44
  let(:encode_class) { CustomEncode }
44
-
45
+
45
46
  it { is_expected.to be_a encode_class }
46
- its(:id) { is_expected.to eq encode.id }
47
+ it { expect(subject.id).to eq encode.id }
47
48
  end
48
49
  end
49
50
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe ActiveEncode::Input do
@@ -6,8 +7,10 @@ describe ActiveEncode::Input do
6
7
  describe 'attributes' do
7
8
  it { is_expected.to respond_to(:id, :url) }
8
9
  it { is_expected.to respond_to(:state, :errors, :created_at, :updated_at) }
9
- it { is_expected.to respond_to(:width, :height, :frame_rate, :checksum,
10
- :audio_codec, :video_codec, :audio_bitrate, :video_bitrate) }
10
+ it {
11
+ is_expected.to respond_to(:width, :height, :frame_rate, :checksum,
12
+ :audio_codec, :video_codec, :audio_bitrate, :video_bitrate)
13
+ }
11
14
  end
12
15
 
13
16
  describe '#valid?' do
@@ -15,8 +18,8 @@ describe ActiveEncode::Input do
15
18
  described_class.new.tap do |obj|
16
19
  obj.id = "1"
17
20
  obj.url = "file:///tmp/video.mp4"
18
- obj.created_at = Time.now
19
- obj.updated_at = Time.now
21
+ obj.created_at = Time.now.utc
22
+ obj.updated_at = Time.now.utc
20
23
  end
21
24
  end
22
25
 
@@ -31,7 +34,7 @@ describe ActiveEncode::Input do
31
34
  expect(valid_input.tap { |obj| obj.created_at = "today" }).not_to be_valid
32
35
  expect(valid_input.tap { |obj| obj.updated_at = nil }).not_to be_valid
33
36
  expect(valid_input.tap { |obj| obj.updated_at = "today" }).not_to be_valid
34
- expect(valid_input.tap { |obj| obj.created_at = Time.now }).not_to be_valid
37
+ expect(valid_input.tap { |obj| obj.created_at = Time.now.utc }).not_to be_valid
35
38
  end
36
39
  end
37
40
  end