s3_relay 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/assets/javascripts/s3_relay.coffee +2 -0
- data/app/helpers/s3_relay/uploads_helper.rb +2 -1
- data/lib/s3_relay/upload_presigner.rb +1 -0
- data/lib/s3_relay/version.rb +1 -1
- data/test/controllers/s3_relay/uploads_controller_test.rb +1 -1
- data/test/dummy/log/development.log +53 -0
- data/test/dummy/log/test.log +17738 -1569
- data/test/helpers/s3_relay/uploads_helper_test.rb +19 -3
- data/test/lib/s3_relay/upload_presigner_test.rb +1 -1
- metadata +3 -3
@@ -4,9 +4,25 @@ describe S3Relay::UploadsHelper do
|
|
4
4
|
before { @product = FactoryGirl.create(:product) }
|
5
5
|
|
6
6
|
describe "#s3_relay_field" do
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
describe "without options" do
|
8
|
+
it do
|
9
|
+
s3_relay_field(@product, :photo_uploads)
|
10
|
+
.must_equal %Q{<div class="s3r-container" data-association="photo_uploads" data-disposition=\"inline\" data-parent-id="#{@product.id}" data-parent-type="product"><input class="s3r-field" id="file" name="file" type="file" /><table class="s3r-upload-list"></table></div>}
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "with multiple: true" do
|
15
|
+
it do
|
16
|
+
s3_relay_field(@product, :photo_uploads, multiple: true)
|
17
|
+
.must_equal %Q{<div class="s3r-container" data-association="photo_uploads" data-disposition=\"inline\" data-parent-id="#{@product.id}" data-parent-type="product"><input class="s3r-field" id="file" multiple="multiple" name="file" type="file" /><table class="s3r-upload-list"></table></div>}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "with disposition: attachment" do
|
22
|
+
it do
|
23
|
+
s3_relay_field(@product, :photo_uploads, disposition: :attachment)
|
24
|
+
.must_equal %Q{<div class="s3r-container" data-association="photo_uploads" data-disposition=\"attachment\" data-parent-id="#{@product.id}" data-parent-type="product"><input class="s3r-field" disposition=\"attachment\" id="file" name="file" type="file" /><table class="s3r-upload-list"></table></div>}
|
25
|
+
end
|
10
26
|
end
|
11
27
|
end
|
12
28
|
|
@@ -29,7 +29,7 @@ describe S3Relay::UploadPresigner do
|
|
29
29
|
data["success_action_status"].must_equal "201"
|
30
30
|
data["acl"].must_equal "acl"
|
31
31
|
data["endpoint"].must_equal "https://bucket.s3-region.amazonaws.com"
|
32
|
-
data["policy"].length.must_equal
|
32
|
+
data["policy"].length.must_equal 400 # TODO: Improve this
|
33
33
|
data["signature"].length.must_equal 28 # TODO: Improve this
|
34
34
|
data["uuid"].must_equal uuid
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3_relay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenny Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-rails
|
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
247
|
version: '0'
|
248
248
|
requirements: []
|
249
249
|
rubyforge_project:
|
250
|
-
rubygems_version: 2.4.
|
250
|
+
rubygems_version: 2.4.5
|
251
251
|
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: Direct uploads to S3 and ingestion by your Rails app.
|