carrierwave-base64 1.5 → 1.6
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: bb68b59ec39a928ef7aeabd149732243c0ed243e
|
4
|
+
data.tar.gz: 8ac609c29884c41a84cd24a0272e9b26489c1be5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9614e1196276d13a6b1f9371681057b4672f2d6f2c21ce6c8d05bc101d08a5c88f46056b1a319fcbcb925bffabd5eaa77795185b1423b4bb0ccd8b1f8bcc48f5
|
7
|
+
data.tar.gz: 3e1cd06819917e46e223469b93532204fe4d8762a4d5a3ad41eabd3cc74d9bd6c3cbf463c32d134411e250d040dc5462d12209e4e2cf3706be46bb3e6f687e1b
|
@@ -5,7 +5,7 @@ RSpec.describe Carrierwave::Base64::Base64StringIO do
|
|
5
5
|
let(:image_data) { "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABKdhH//2Q==" }
|
6
6
|
subject { described_class.new image_data }
|
7
7
|
|
8
|
-
it "determines the image format from the
|
8
|
+
it "determines the image format from the Data URI scheme" do
|
9
9
|
expect(subject.file_format).to eql("jpg")
|
10
10
|
end
|
11
11
|
|
@@ -18,7 +18,7 @@ RSpec.describe Carrierwave::Base64::Base64StringIO do
|
|
18
18
|
let(:image_data) { "data:application/pdf;base64,/9j/4AAQSkZJRgABAQEASABKdhH//2Q==" }
|
19
19
|
subject { described_class.new image_data }
|
20
20
|
|
21
|
-
it "determines the image format from the
|
21
|
+
it "determines the image format from the Data URI scheme" do
|
22
22
|
expect(subject.file_format).to eql("pdf")
|
23
23
|
end
|
24
24
|
|
@@ -27,6 +27,19 @@ RSpec.describe Carrierwave::Base64::Base64StringIO do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
context "correct mp3 data" do
|
31
|
+
let(:audio_data) { "data:audio/mp3;base64,/9j/4AAQSkZJRgABAQEASABKdhH//2Q==" }
|
32
|
+
subject { described_class.new audio_data }
|
33
|
+
|
34
|
+
it "determines the image format from the Data URI scheme" do
|
35
|
+
expect(subject.file_format).to eql("mp3")
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should respond to :original_filename" do
|
39
|
+
expect(subject.original_filename).to eql("file.mp3")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
30
43
|
context "incorrect image data" do
|
31
44
|
it "raises an ArgumentError if Data URI scheme format is missing" do
|
32
45
|
expect do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-base64
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Lebedev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|