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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +80 -0
- data/.rubocop.yml +9 -70
- data/.rubocop_todo.yml +68 -0
- data/Gemfile +5 -4
- data/README.md +69 -0
- data/active_encode.gemspec +12 -3
- data/app/controllers/active_encode/encode_record_controller.rb +1 -0
- data/app/jobs/active_encode/polling_job.rb +1 -1
- data/app/models/active_encode/encode_record.rb +1 -0
- data/db/migrate/20180822021048_create_active_encode_encode_records.rb +1 -0
- data/db/migrate/20190702153755_add_create_options_to_active_encode_encode_records.rb +6 -0
- data/db/migrate/20190712174821_add_progress_to_active_encode_encode_records.rb +6 -0
- data/lib/active_encode.rb +1 -0
- data/lib/active_encode/base.rb +2 -2
- data/lib/active_encode/callbacks.rb +1 -0
- data/lib/active_encode/core.rb +4 -3
- data/lib/active_encode/engine.rb +1 -0
- data/lib/active_encode/engine_adapter.rb +1 -0
- data/lib/active_encode/engine_adapters.rb +4 -1
- data/lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb +31 -29
- data/lib/active_encode/engine_adapters/ffmpeg_adapter.rb +138 -87
- data/lib/active_encode/engine_adapters/matterhorn_adapter.rb +5 -4
- data/lib/active_encode/engine_adapters/media_convert_adapter.rb +399 -0
- data/lib/active_encode/engine_adapters/media_convert_output.rb +104 -0
- data/lib/active_encode/engine_adapters/pass_through_adapter.rb +239 -0
- data/lib/active_encode/engine_adapters/test_adapter.rb +5 -4
- data/lib/active_encode/engine_adapters/zencoder_adapter.rb +3 -2
- data/lib/active_encode/errors.rb +6 -0
- data/lib/active_encode/global_id.rb +2 -1
- data/lib/active_encode/input.rb +3 -2
- data/lib/active_encode/output.rb +3 -2
- data/lib/active_encode/persistence.rb +11 -5
- data/lib/active_encode/polling.rb +3 -2
- data/lib/active_encode/spec/shared_specs.rb +2 -0
- data/{spec/shared_specs/engine_adapter_specs.rb → lib/active_encode/spec/shared_specs/engine_adapter.rb} +37 -38
- data/lib/active_encode/status.rb +1 -0
- data/lib/active_encode/technical_metadata.rb +3 -2
- data/lib/active_encode/version.rb +2 -1
- data/lib/file_locator.rb +8 -9
- data/spec/controllers/encode_record_controller_spec.rb +4 -3
- data/spec/fixtures/ffmpeg/cancelled-id/cancelled +0 -0
- data/spec/fixtures/file with space.low.mp4 +0 -0
- data/spec/fixtures/file with space.mp4 +0 -0
- data/spec/fixtures/fireworks.low.mp4 +0 -0
- data/spec/fixtures/media_convert/endpoints.json +1 -0
- data/spec/fixtures/media_convert/job_canceled.json +412 -0
- data/spec/fixtures/media_convert/job_canceling.json +1 -0
- data/spec/fixtures/media_convert/job_completed.json +359 -0
- data/spec/fixtures/media_convert/job_completed_detail.json +1 -0
- data/spec/fixtures/media_convert/job_completed_detail_query.json +1 -0
- data/spec/fixtures/media_convert/job_completed_empty_detail.json +1 -0
- data/spec/fixtures/media_convert/job_created.json +408 -0
- data/spec/fixtures/media_convert/job_failed.json +406 -0
- data/spec/fixtures/media_convert/job_progressing.json +414 -0
- data/spec/fixtures/pass_through/cancelled-id/cancelled +0 -0
- data/spec/fixtures/pass_through/cancelled-id/input_metadata +90 -0
- data/spec/fixtures/pass_through/completed-id/completed +0 -0
- data/spec/fixtures/pass_through/completed-id/input_metadata +102 -0
- data/spec/fixtures/pass_through/completed-id/output_metadata-high +90 -0
- data/spec/fixtures/pass_through/completed-id/output_metadata-low +90 -0
- data/spec/fixtures/pass_through/completed-id/video-high.mp4 +0 -0
- data/spec/fixtures/pass_through/completed-id/video-low.mp4 +0 -0
- data/spec/fixtures/pass_through/failed-id/error.log +1 -0
- data/spec/fixtures/pass_through/failed-id/input_metadata +90 -0
- data/spec/fixtures/pass_through/running-id/input_metadata +90 -0
- data/spec/integration/elastic_transcoder_adapter_spec.rb +30 -30
- data/spec/integration/ffmpeg_adapter_spec.rb +93 -25
- data/spec/integration/matterhorn_adapter_spec.rb +45 -44
- data/spec/integration/media_convert_adapter_spec.rb +152 -0
- data/spec/integration/pass_through_adapter_spec.rb +151 -0
- data/spec/integration/zencoder_adapter_spec.rb +210 -209
- data/spec/rails_helper.rb +1 -0
- data/spec/routing/encode_record_controller_routing_spec.rb +1 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +13 -12
- data/spec/units/callbacks_spec.rb +3 -2
- data/spec/units/core_spec.rb +26 -25
- data/spec/units/engine_adapter_spec.rb +1 -0
- data/spec/units/file_locator_spec.rb +20 -19
- data/spec/units/global_id_spec.rb +12 -11
- data/spec/units/input_spec.rb +8 -5
- data/spec/units/output_spec.rb +8 -5
- data/spec/units/persistence_spec.rb +15 -11
- data/spec/units/polling_job_spec.rb +7 -6
- data/spec/units/polling_spec.rb +1 -0
- data/spec/units/status_spec.rb +3 -3
- metadata +158 -14
- data/.travis.yml +0 -19
data/spec/rails_helper.rb
CHANGED
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
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require 'rails/generators'
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
+
class TestAppGenerator < Rails::Generators::Base
|
6
|
+
source_root "./spec/test_app_templates"
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
|
data/spec/units/core_spec.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
61
|
-
|
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
|
-
|
68
|
-
|
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
|
-
|
79
|
-
|
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
|
-
|
87
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
117
|
-
|
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
|
-
|
125
|
-
|
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
|
-
|
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
|
# 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 "
|
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 "
|
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 "
|
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 "
|
50
|
+
it "returns the correct location" do
|
50
51
|
expect(locator.location).to eq path
|
51
52
|
end
|
52
53
|
|
53
|
-
it "
|
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
|
61
|
+
before do
|
61
62
|
allow(File).to receive(:open).and_return file
|
62
63
|
end
|
63
64
|
|
64
|
-
it "
|
65
|
+
it "returns reader" do
|
65
66
|
expect(locator.reader).to eq file
|
66
67
|
end
|
67
68
|
|
68
|
-
it "
|
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 "
|
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 "
|
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 "
|
89
|
+
it "tells if file exists" do
|
89
90
|
expect(locator.exist?).to be_truthy
|
90
91
|
end
|
91
92
|
|
92
|
-
it "
|
93
|
+
it "returns reader" do
|
93
94
|
expect(locator.reader).to be_a StringIO
|
94
95
|
end
|
95
96
|
|
96
|
-
it "
|
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 "
|
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 "
|
111
|
+
it "returns the correct location" do
|
111
112
|
expect(locator.location).to eq source
|
112
113
|
end
|
113
114
|
|
114
|
-
it "
|
115
|
+
it "tells if file exists" do
|
115
116
|
expect(locator.exist?).to be_falsy
|
116
117
|
end
|
117
118
|
|
118
|
-
it "
|
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 "
|
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
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
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
|
-
|
47
|
+
it { expect(subject.id).to eq encode.id }
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
data/spec/units/input_spec.rb
CHANGED
@@ -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 {
|
10
|
-
|
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
|