dynamic_paperclip 1.0.0 → 1.0.1

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: 532f05d2c123371561ae9a1fabdde9621994a72c
4
- data.tar.gz: af6332a7d263cac5c5bc59cb6ba532f8fdb67e1c
3
+ metadata.gz: 6527eee9a29b87e3c0bfa0ae5beacd1df2fc3c92
4
+ data.tar.gz: 64e6c73271c87eb8c75d4dacc7aa84a7620e0161
5
5
  SHA512:
6
- metadata.gz: 4d410c0304dfe6fe9c195e08c72e7b9875ee091e8e194c36ffeadc025915237b32639033f5197db425ed203ff3623ce54241c8614c33f5ee267be6ad34fe3611
7
- data.tar.gz: 4162c46ed79f90659a04fffa7c24a5754ee866ffb819d0b94213444a99de742ba08556bb35474faf928bfc3e97405e09248bae03ead968e3c78ee769dc63964d
6
+ metadata.gz: f057538afffbfe3435655f14d9492c069a5a8b3e8094ce465f6f73d69fb352cf4ea0788511b186ae7011b9fe43ae57e1fa4692b80277a6ad38c98bfcc2f5cb88
7
+ data.tar.gz: 0f3db47e3b816ea7fcecd977769b447c66513689286138b2ad52656896b066876d81c0c7639b5a6dad90c878d19ef4a33b12fdf26250dd2f7fb0102973a3d485
data/README.md CHANGED
@@ -14,7 +14,7 @@ Getting started
14
14
 
15
15
  ### Requirements
16
16
 
17
- Dynamic Paperclip requires Paperclip 3.5.0 or above and only currently supports Paperclip's File Storage.
17
+ Dynamic Paperclip requires Paperclip 4 or above and only currently supports Paperclip's File Storage.
18
18
 
19
19
  ### Application
20
20
 
@@ -20,11 +20,6 @@ module DynamicPaperclip
20
20
  id = id_from_partition(match[:id])
21
21
  attachment = klass.find(id).send(name)
22
22
 
23
- # When the filename is wrong, return a 404
24
- if !attachment.exists? || attachment.original_filename != URI.unescape(match[:filename])
25
- return [404, {}, []]
26
- end
27
-
28
23
  # The definition will be escaped twice in the URL, so we need to unescape it once.
29
24
  # We should always reference dynamic style names after escaping once - that's how they reside on the FS.
30
25
  style_name = StyleNaming.dynamic_style_name_from_definition(CGI.unescape(match[:definition]), false)
@@ -1,3 +1,3 @@
1
1
  module DynamicPaperclip
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
Binary file
@@ -5631,3 +5631,554 @@ Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f
5631
5631
  SQL (1.1ms) UPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "image_file_name" = ?, "updated_at" = ? WHERE "photos"."id" = ? [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:09:21.579296"], ["image_file_name", "rails.png"], ["updated_at", "2018-11-28 17:09:21.683165"], ["id", 1]]
5632
5632
   (0.1ms) RELEASE SAVEPOINT active_record_1
5633
5633
   (0.6ms) rollback transaction
5634
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5635
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5636
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5637
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
5638
+  (0.1ms) begin transaction
5639
+  (0.1ms) commit transaction
5640
+  (0.1ms) begin transaction
5641
+ Fixture Delete (0.7ms) DELETE FROM "photos"
5642
+ Fixture Insert (0.3ms) INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:47:45.682840', '2018-11-28 17:47:45.682840')
5643
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:47:45.682840', '2018-11-28 17:47:45.682840')
5644
+  (1.0ms) commit transaction
5645
+  (0.1ms) begin transaction
5646
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5647
+ AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
5648
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5649
+ Photo Load (0.2ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5650
+  (0.1ms) rollback transaction
5651
+  (0.1ms) begin transaction
5652
+ -----------------------------------------------------------------------------------------
5653
+ AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
5654
+ -----------------------------------------------------------------------------------------
5655
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5656
+  (0.1ms) rollback transaction
5657
+  (0.0ms) begin transaction
5658
+ -------------------------------------------------------------------------------------
5659
+ AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
5660
+ -------------------------------------------------------------------------------------
5661
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5662
+  (0.0ms) rollback transaction
5663
+  (0.1ms) begin transaction
5664
+ ---------------------------------------------------------------------------------------------------
5665
+ AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
5666
+ ---------------------------------------------------------------------------------------------------
5667
+  (0.0ms) rollback transaction
5668
+  (0.1ms) begin transaction
5669
+ ---------------------------------------------------------------------------------------------------------------------
5670
+ AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
5671
+ ---------------------------------------------------------------------------------------------------------------------
5672
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5673
+  (0.1ms) rollback transaction
5674
+  (0.1ms) begin transaction
5675
+ ---------------------------------------------------------------------------------------
5676
+ AttachmentTest: test_: Attachment should raise error if no secret has been configured.
5677
+ ---------------------------------------------------------------------------------------
5678
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5679
+  (0.1ms) rollback transaction
5680
+  (0.0ms) begin transaction
5681
+ -----------------------------------------------------------------------------------------------
5682
+ AttachmentTest: test_: Attachment should return true from query method when attachment is set.
5683
+ -----------------------------------------------------------------------------------------------
5684
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5685
+  (0.1ms) rollback transaction
5686
+  (0.0ms) begin transaction
5687
+ ----------------------------------------------------------------------------------------------------
5688
+ AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
5689
+ ----------------------------------------------------------------------------------------------------
5690
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
5691
+  (0.0ms) rollback transaction
5692
+  (0.0ms) begin transaction
5693
+ ---------------------------------------------------------------------------------------------------------------
5694
+ AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
5695
+ ---------------------------------------------------------------------------------------------------------------
5696
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5697
+  (0.1ms) rollback transaction
5698
+  (0.1ms) begin transaction
5699
+ -------------------------------------------------------------------------------------
5700
+ InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
5701
+ -------------------------------------------------------------------------------------
5702
+  (0.1ms) rollback transaction
5703
+  (0.1ms) begin transaction
5704
+ ---------------------------------------------------------------------------------------------------------------------
5705
+ DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
5706
+ ---------------------------------------------------------------------------------------------------------------------
5707
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5708
+ Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:47:45 -0500
5709
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5710
+ [paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-68550-1ac12pi.png to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-68550-1oljqg3.png
5711
+ Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-68550-1oljqg3.png'
5712
+ Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-68550-1ac12pi.png[0]' 2>/dev/null
5713
+ Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-68550-1ac12pi.png[0]'
5714
+ Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-68550-1ac12pi.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/7cfde77299ff1415a9c3e943212308f120181128-68550-1jxn2ae'
5715
+ [paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/7cfde77299ff1415a9c3e943212308f120181128-68550-1jxn2ae to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/67b5dd703188dc85d4b6d85b681ef76320181128-68550-o2yhlj
5716
+  (0.2ms) SAVEPOINT active_record_1
5717
+ SQL (0.5ms) UPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ? [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:47:45.967206"], ["updated_at", "2018-11-28 17:47:46.222995"], ["image_file_name", "rails.png"], ["id", 1]]
5718
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5719
+  (0.4ms) rollback transaction
5720
+  (0.1ms) begin transaction
5721
+ --------------------------------
5722
+ DynamicPaperclipTest: test_truth
5723
+ --------------------------------
5724
+  (0.0ms) rollback transaction
5725
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
5726
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5727
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5728
+ ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
5729
+  (0.1ms) begin transaction
5730
+  (0.0ms) commit transaction
5731
+  (0.3ms) begin transaction
5732
+ --------------------------------
5733
+ DynamicPaperclipTest: test_truth
5734
+ --------------------------------
5735
+  (0.1ms) rollback transaction
5736
+  (0.1ms) begin transaction
5737
+ Fixture Delete (0.6ms) DELETE FROM "photos"
5738
+ Fixture Insert (0.5ms) INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:52:19.991793', '2018-11-28 17:52:19.991793')
5739
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:52:19.991793', '2018-11-28 17:52:19.991793')
5740
+  (0.7ms) commit transaction
5741
+  (0.1ms) begin transaction
5742
+ -----------------------------------------------------------------------------------------------
5743
+ AttachmentTest: test_: Attachment should return true from query method when attachment is set.
5744
+ -----------------------------------------------------------------------------------------------
5745
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5746
+  (0.1ms) rollback transaction
5747
+  (0.1ms) begin transaction
5748
+ -----------------------------------------------------------------------------------------
5749
+ AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
5750
+ -----------------------------------------------------------------------------------------
5751
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5752
+  (0.1ms) rollback transaction
5753
+  (0.0ms) begin transaction
5754
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5755
+ AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
5756
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5757
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5758
+  (0.1ms) rollback transaction
5759
+  (0.1ms) begin transaction
5760
+ ---------------------------------------------------------------------------------------------------------------
5761
+ AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
5762
+ ---------------------------------------------------------------------------------------------------------------
5763
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5764
+  (0.1ms) rollback transaction
5765
+  (0.0ms) begin transaction
5766
+ ----------------------------------------------------------------------------------------------------
5767
+ AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
5768
+ ----------------------------------------------------------------------------------------------------
5769
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
5770
+  (0.0ms) rollback transaction
5771
+  (0.0ms) begin transaction
5772
+ ---------------------------------------------------------------------------------------------------------------------
5773
+ AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
5774
+ ---------------------------------------------------------------------------------------------------------------------
5775
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5776
+  (0.1ms) rollback transaction
5777
+  (0.0ms) begin transaction
5778
+ ---------------------------------------------------------------------------------------------------
5779
+ AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
5780
+ ---------------------------------------------------------------------------------------------------
5781
+  (0.0ms) rollback transaction
5782
+  (0.0ms) begin transaction
5783
+ ---------------------------------------------------------------------------------------
5784
+ AttachmentTest: test_: Attachment should raise error if no secret has been configured.
5785
+ ---------------------------------------------------------------------------------------
5786
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5787
+  (0.1ms) rollback transaction
5788
+  (0.1ms) begin transaction
5789
+ -------------------------------------------------------------------------------------
5790
+ AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
5791
+ -------------------------------------------------------------------------------------
5792
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5793
+  (0.1ms) rollback transaction
5794
+  (0.1ms) begin transaction
5795
+ -------------------------------------------------------------------------------------
5796
+ InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
5797
+ -------------------------------------------------------------------------------------
5798
+  (0.1ms) rollback transaction
5799
+  (0.0ms) begin transaction
5800
+ ---------------------------------------------------------------------------------------------------------------------
5801
+ DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
5802
+ ---------------------------------------------------------------------------------------------------------------------
5803
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5804
+ Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:52:20 -0500
5805
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5806
+  (0.1ms) rollback transaction
5807
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5808
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5809
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5810
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
5811
+  (0.1ms) begin transaction
5812
+  (0.1ms) commit transaction
5813
+  (0.1ms) begin transaction
5814
+ Fixture Delete (0.4ms) DELETE FROM "photos"
5815
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:52:50.013626', '2018-11-28 17:52:50.013626')
5816
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:52:50.013626', '2018-11-28 17:52:50.013626')
5817
+  (3.2ms) commit transaction
5818
+  (0.1ms) begin transaction
5819
+ ---------------------------------------------------------------------------------------
5820
+ AttachmentTest: test_: Attachment should raise error if no secret has been configured.
5821
+ ---------------------------------------------------------------------------------------
5822
+ Photo Load (0.2ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5823
+  (0.2ms) rollback transaction
5824
+  (0.1ms) begin transaction
5825
+ ---------------------------------------------------------------------------------------------------------------------
5826
+ AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
5827
+ ---------------------------------------------------------------------------------------------------------------------
5828
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5829
+  (0.1ms) rollback transaction
5830
+  (0.1ms) begin transaction
5831
+ ---------------------------------------------------------------------------------------------------
5832
+ AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
5833
+ ---------------------------------------------------------------------------------------------------
5834
+  (0.1ms) rollback transaction
5835
+  (0.1ms) begin transaction
5836
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5837
+ AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
5838
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5839
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5840
+  (0.2ms) rollback transaction
5841
+  (0.1ms) begin transaction
5842
+ -----------------------------------------------------------------------------------------
5843
+ AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
5844
+ -----------------------------------------------------------------------------------------
5845
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5846
+  (0.1ms) rollback transaction
5847
+  (0.0ms) begin transaction
5848
+ -------------------------------------------------------------------------------------
5849
+ AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
5850
+ -------------------------------------------------------------------------------------
5851
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5852
+  (0.1ms) rollback transaction
5853
+  (0.0ms) begin transaction
5854
+ ----------------------------------------------------------------------------------------------------
5855
+ AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
5856
+ ----------------------------------------------------------------------------------------------------
5857
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
5858
+  (0.1ms) rollback transaction
5859
+  (0.0ms) begin transaction
5860
+ ---------------------------------------------------------------------------------------------------------------
5861
+ AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
5862
+ ---------------------------------------------------------------------------------------------------------------
5863
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5864
+  (0.1ms) rollback transaction
5865
+  (0.0ms) begin transaction
5866
+ -----------------------------------------------------------------------------------------------
5867
+ AttachmentTest: test_: Attachment should return true from query method when attachment is set.
5868
+ -----------------------------------------------------------------------------------------------
5869
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5870
+  (0.1ms) rollback transaction
5871
+  (0.1ms) begin transaction
5872
+ --------------------------------
5873
+ DynamicPaperclipTest: test_truth
5874
+ --------------------------------
5875
+  (0.1ms) rollback transaction
5876
+  (0.0ms) begin transaction
5877
+ -------------------------------------------------------------------------------------
5878
+ InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
5879
+ -------------------------------------------------------------------------------------
5880
+  (0.1ms) rollback transaction
5881
+  (0.1ms) begin transaction
5882
+ ---------------------------------------------------------------------------------------------------------------------
5883
+ DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
5884
+ ---------------------------------------------------------------------------------------------------------------------
5885
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5886
+ Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:52:50 -0500
5887
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5888
+ Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69811-1okxz7l.png[0]' 2>/dev/null
5889
+ Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69811-1okxz7l.png[0]'
5890
+ Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69811-1okxz7l.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/cd6db9fed4102b0035b86d3e538c178520181128-69811-uh4vh5'
5891
+  (0.1ms) SAVEPOINT active_record_1
5892
+ SQL (0.5ms) UPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ? [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:52:50.286107"], ["updated_at", "2018-11-28 17:52:50.389149"], ["image_file_name", "rails.png"], ["id", 1]]
5893
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5894
+  (0.4ms) rollback transaction
5895
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5896
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5897
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5898
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
5899
+  (0.1ms) begin transaction
5900
+  (0.0ms) commit transaction
5901
+  (0.1ms) begin transaction
5902
+ --------------------------------
5903
+ DynamicPaperclipTest: test_truth
5904
+ --------------------------------
5905
+  (0.0ms) rollback transaction
5906
+  (0.0ms) begin transaction
5907
+ -------------------------------------------------------------------------------------
5908
+ InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
5909
+ -------------------------------------------------------------------------------------
5910
+  (0.1ms) rollback transaction
5911
+  (0.1ms) begin transaction
5912
+ Fixture Delete (0.5ms) DELETE FROM "photos"
5913
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:53:00.207558', '2018-11-28 17:53:00.207558')
5914
+ Fixture Insert (0.0ms) INSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:53:00.207558', '2018-11-28 17:53:00.207558')
5915
+  (0.6ms) commit transaction
5916
+  (0.1ms) begin transaction
5917
+ ---------------------------------------------------------------------------------------------------------------------
5918
+ DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
5919
+ ---------------------------------------------------------------------------------------------------------------------
5920
+ Photo Load (0.2ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5921
+ Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:53:00 -0500
5922
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5923
+ Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69826-1naycz4.png'
5924
+ Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69826-1i34kg1.png[0]' 2>/dev/null
5925
+ Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69826-1i34kg1.png[0]'
5926
+ Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69826-1i34kg1.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/f5db26b79109e7db519c7512dd99565220181128-69826-1n6w6kf'
5927
+  (0.1ms) SAVEPOINT active_record_1
5928
+ SQL (0.5ms) UPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ? [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:53:00.379783"], ["updated_at", "2018-11-28 17:53:00.462360"], ["image_file_name", "rails.png"], ["id", 1]]
5929
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5930
+  (0.5ms) rollback transaction
5931
+  (0.1ms) begin transaction
5932
+ ---------------------------------------------------------------------------------------------------------------
5933
+ AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
5934
+ ---------------------------------------------------------------------------------------------------------------
5935
+ Photo Load (0.3ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5936
+  (0.1ms) rollback transaction
5937
+  (0.1ms) begin transaction
5938
+ ---------------------------------------------------------------------------------------------------------------------
5939
+ AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
5940
+ ---------------------------------------------------------------------------------------------------------------------
5941
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5942
+  (0.1ms) rollback transaction
5943
+  (0.1ms) begin transaction
5944
+ -------------------------------------------------------------------------------------
5945
+ AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
5946
+ -------------------------------------------------------------------------------------
5947
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5948
+  (0.1ms) rollback transaction
5949
+  (0.0ms) begin transaction
5950
+ ---------------------------------------------------------------------------------------
5951
+ AttachmentTest: test_: Attachment should raise error if no secret has been configured.
5952
+ ---------------------------------------------------------------------------------------
5953
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5954
+  (0.1ms) rollback transaction
5955
+  (0.0ms) begin transaction
5956
+ ----------------------------------------------------------------------------------------------------
5957
+ AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
5958
+ ----------------------------------------------------------------------------------------------------
5959
+ Photo Load (0.4ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
5960
+  (0.1ms) rollback transaction
5961
+  (0.1ms) begin transaction
5962
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5963
+ AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
5964
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
5965
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5966
+  (0.1ms) rollback transaction
5967
+  (0.1ms) begin transaction
5968
+ ---------------------------------------------------------------------------------------------------
5969
+ AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
5970
+ ---------------------------------------------------------------------------------------------------
5971
+  (0.0ms) rollback transaction
5972
+  (0.0ms) begin transaction
5973
+ -----------------------------------------------------------------------------------------------
5974
+ AttachmentTest: test_: Attachment should return true from query method when attachment is set.
5975
+ -----------------------------------------------------------------------------------------------
5976
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5977
+  (0.1ms) rollback transaction
5978
+  (0.1ms) begin transaction
5979
+ -----------------------------------------------------------------------------------------
5980
+ AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
5981
+ -----------------------------------------------------------------------------------------
5982
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
5983
+  (0.1ms) rollback transaction
5984
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5985
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5986
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5987
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
5988
+  (0.1ms) begin transaction
5989
+  (0.2ms) commit transaction
5990
+  (0.1ms) begin transaction
5991
+ --------------------------------
5992
+ DynamicPaperclipTest: test_truth
5993
+ --------------------------------
5994
+  (0.1ms) rollback transaction
5995
+  (0.1ms) begin transaction
5996
+ Fixture Delete (0.7ms) DELETE FROM "photos"
5997
+ Fixture Insert (0.2ms) INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:53:33.282701', '2018-11-28 17:53:33.282701')
5998
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:53:33.282701', '2018-11-28 17:53:33.282701')
5999
+  (1.3ms) commit transaction
6000
+  (0.1ms) begin transaction
6001
+ -----------------------------------------------------------------------------------------------
6002
+ AttachmentTest: test_: Attachment should return true from query method when attachment is set.
6003
+ -----------------------------------------------------------------------------------------------
6004
+ Photo Load (0.2ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6005
+  (0.1ms) rollback transaction
6006
+  (0.1ms) begin transaction
6007
+ -----------------------------------------------------------------------------------------
6008
+ AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
6009
+ -----------------------------------------------------------------------------------------
6010
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6011
+  (0.1ms) rollback transaction
6012
+  (0.1ms) begin transaction
6013
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
6014
+ AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
6015
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
6016
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6017
+  (0.1ms) rollback transaction
6018
+  (0.1ms) begin transaction
6019
+ ---------------------------------------------------------------------------------------------------------------
6020
+ AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
6021
+ ---------------------------------------------------------------------------------------------------------------
6022
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6023
+  (0.1ms) rollback transaction
6024
+  (0.1ms) begin transaction
6025
+ ----------------------------------------------------------------------------------------------------
6026
+ AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
6027
+ ----------------------------------------------------------------------------------------------------
6028
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
6029
+  (0.1ms) rollback transaction
6030
+  (0.1ms) begin transaction
6031
+ ---------------------------------------------------------------------------------------------------------------------
6032
+ AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
6033
+ ---------------------------------------------------------------------------------------------------------------------
6034
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6035
+  (0.1ms) rollback transaction
6036
+  (0.1ms) begin transaction
6037
+ -------------------------------------------------------------------------------------
6038
+ AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
6039
+ -------------------------------------------------------------------------------------
6040
+ Photo Load (0.3ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6041
+  (0.2ms) rollback transaction
6042
+  (0.1ms) begin transaction
6043
+ ---------------------------------------------------------------------------------------
6044
+ AttachmentTest: test_: Attachment should raise error if no secret has been configured.
6045
+ ---------------------------------------------------------------------------------------
6046
+ Photo Load (0.2ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6047
+  (0.1ms) rollback transaction
6048
+  (0.1ms) begin transaction
6049
+ ---------------------------------------------------------------------------------------------------
6050
+ AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
6051
+ ---------------------------------------------------------------------------------------------------
6052
+  (0.1ms) rollback transaction
6053
+  (0.1ms) begin transaction
6054
+ ---------------------------------------------------------------------------------------------------------------------
6055
+ DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
6056
+ ---------------------------------------------------------------------------------------------------------------------
6057
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6058
+ Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:53:33 -0500
6059
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6060
+ [paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69934-1unz6ls.png to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69934-1ohw31p.png
6061
+ Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69934-1ohw31p.png'
6062
+ Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69934-1unz6ls.png[0]' 2>/dev/null
6063
+ Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69934-1unz6ls.png[0]'
6064
+ Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-69934-1unz6ls.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/1309f46c1d8e51448c7ae402e7ee5c6c20181128-69934-16vmesz'
6065
+ [paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/1309f46c1d8e51448c7ae402e7ee5c6c20181128-69934-16vmesz to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/35595ed2657ec7f9874f2c877379642120181128-69934-1tcrkd0
6066
+  (0.1ms) SAVEPOINT active_record_1
6067
+ SQL (0.7ms) UPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ? [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:53:33.618647"], ["updated_at", "2018-11-28 17:53:33.757813"], ["image_file_name", "rails.png"], ["id", 1]]
6068
+  (0.1ms) RELEASE SAVEPOINT active_record_1
6069
+  (0.8ms) rollback transaction
6070
+  (0.1ms) begin transaction
6071
+ -------------------------------------------------------------------------------------
6072
+ InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
6073
+ -------------------------------------------------------------------------------------
6074
+  (0.1ms) rollback transaction
6075
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
6076
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
6077
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
6078
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
6079
+  (0.0ms) begin transaction
6080
+  (0.1ms) commit transaction
6081
+  (0.1ms) begin transaction
6082
+ --------------------------------
6083
+ DynamicPaperclipTest: test_truth
6084
+ --------------------------------
6085
+  (0.0ms) rollback transaction
6086
+  (0.1ms) begin transaction
6087
+ Fixture Delete (0.9ms) DELETE FROM "photos"
6088
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:54:03.569951', '2018-11-28 17:54:03.569951')
6089
+ Fixture Insert (0.1ms) INSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:54:03.569951', '2018-11-28 17:54:03.569951')
6090
+  (0.8ms) commit transaction
6091
+  (0.1ms) begin transaction
6092
+ ---------------------------------------------------------------------------------------------------------------------
6093
+ DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
6094
+ ---------------------------------------------------------------------------------------------------------------------
6095
+ Photo Load (0.2ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6096
+ Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:54:03 -0500
6097
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6098
+ [paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-70027-ht1xzt.png to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-70027-k2wp8h.png
6099
+ Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-70027-k2wp8h.png'
6100
+ Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-70027-ht1xzt.png[0]' 2>/dev/null
6101
+ Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-70027-ht1xzt.png[0]'
6102
+ Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-70027-ht1xzt.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/a131e85baa81afd9d7c9ff011b8e910920181128-70027-vd3555'
6103
+ [paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/a131e85baa81afd9d7c9ff011b8e910920181128-70027-vd3555 to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4ec60a82fd1a8f1814cf9c61676fe77d20181128-70027-10ycmjm
6104
+  (0.2ms) SAVEPOINT active_record_1
6105
+ SQL (0.4ms) UPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ? [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:54:03.734449"], ["updated_at", "2018-11-28 17:54:03.802656"], ["image_file_name", "rails.png"], ["id", 1]]
6106
+  (0.1ms) RELEASE SAVEPOINT active_record_1
6107
+  (0.3ms) rollback transaction
6108
+  (0.0ms) begin transaction
6109
+ -------------------------------------------------------------------------------------
6110
+ InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
6111
+ -------------------------------------------------------------------------------------
6112
+  (0.1ms) rollback transaction
6113
+  (0.1ms) begin transaction
6114
+ ---------------------------------------------------------------------------------------------------
6115
+ AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
6116
+ ---------------------------------------------------------------------------------------------------
6117
+  (0.0ms) rollback transaction
6118
+  (0.1ms) begin transaction
6119
+ ---------------------------------------------------------------------------------------------------------------------
6120
+ AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
6121
+ ---------------------------------------------------------------------------------------------------------------------
6122
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6123
+  (0.1ms) rollback transaction
6124
+  (0.0ms) begin transaction
6125
+ ---------------------------------------------------------------------------------------------------------------
6126
+ AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
6127
+ ---------------------------------------------------------------------------------------------------------------
6128
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6129
+  (0.1ms) rollback transaction
6130
+  (0.1ms) begin transaction
6131
+ -----------------------------------------------------------------------------------------
6132
+ AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
6133
+ -----------------------------------------------------------------------------------------
6134
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6135
+  (0.1ms) rollback transaction
6136
+  (0.0ms) begin transaction
6137
+ ---------------------------------------------------------------------------------------
6138
+ AttachmentTest: test_: Attachment should raise error if no secret has been configured.
6139
+ ---------------------------------------------------------------------------------------
6140
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6141
+  (0.1ms) rollback transaction
6142
+  (0.1ms) begin transaction
6143
+ -----------------------------------------------------------------------------------------------
6144
+ AttachmentTest: test_: Attachment should return true from query method when attachment is set.
6145
+ -----------------------------------------------------------------------------------------------
6146
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6147
+  (0.1ms) rollback transaction
6148
+  (0.1ms) begin transaction
6149
+ ----------------------------------------------------------------------------------------------------
6150
+ AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
6151
+ ----------------------------------------------------------------------------------------------------
6152
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
6153
+  (0.2ms) rollback transaction
6154
+  (0.1ms) begin transaction
6155
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
6156
+ AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
6157
+ ------------------------------------------------------------------------------------------------------------------------------------------------------
6158
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6159
+  (0.1ms) rollback transaction
6160
+  (0.0ms) begin transaction
6161
+ -------------------------------------------------------------------------------------
6162
+ AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
6163
+ -------------------------------------------------------------------------------------
6164
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6165
+  (0.0ms) rollback transaction
6166
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
6167
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
6168
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
6169
+ ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
6170
+  (0.1ms) begin transaction
6171
+  (0.0ms) commit transaction
6172
+  (0.1ms) begin transaction
6173
+ Fixture Delete (0.6ms) DELETE FROM "photos"
6174
+ Fixture Insert (0.3ms) INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 18:03:29.062818', '2018-11-28 18:03:29.062818')
6175
+ Fixture Insert (0.0ms) INSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 18:03:29.062818', '2018-11-28 18:03:29.062818')
6176
+  (0.9ms) commit transaction
6177
+  (0.0ms) begin transaction
6178
+ ---------------------------------------------------------------------------------------------------------------------
6179
+ DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
6180
+ ---------------------------------------------------------------------------------------------------------------------
6181
+ Photo Load (0.3ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6182
+ Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 13:03:29 -0500
6183
+ Photo Load (0.1ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
6184
+  (0.1ms) rollback transaction
@@ -19,7 +19,7 @@ class DynamicPaperclip::AttachmentStyleGeneratorTest < MiniTest::Unit::TestCase
19
19
  @app = stub('Application', :call => [200, {}, ''])
20
20
 
21
21
  @foo = stub('foo')
22
- @attachment = stub('image attachment', :path => File.join(FIXTURES_DIR, 'rails.png'), :original_filename => 'rails.png', :content_type => 'image/jpeg')
22
+ @attachment = stub('image attachment', :path => File.join(FIXTURES_DIR, 'rails.png'), :content_type => 'image/jpeg')
23
23
  @attachment.stubs(:exists?).returns(true)
24
24
 
25
25
  Foo.stubs(:find).with(1).returns @foo
@@ -30,43 +30,43 @@ class DynamicPaperclip::AttachmentStyleGeneratorTest < MiniTest::Unit::TestCase
30
30
  @attachment.expects(:exists?).with(:dynamic_42x42).returns(true)
31
31
  @attachment.expects(:process_dynamic_style).never
32
32
 
33
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
33
+ get '/system/foos/images/1/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
34
34
  end
35
35
 
36
36
  should 'process style if it is dynamic and does not exist' do
37
37
  @attachment.expects(:exists?).with(:dynamic_42x42).returns(false)
38
38
  @attachment.expects(:process_dynamic_style).once
39
39
 
40
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
40
+ get '/system/foos/images/1/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
41
41
  end
42
42
 
43
43
  should 'find record when an ID is used' do
44
44
  Foo.expects(:find).with(1).returns @foo
45
45
 
46
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
46
+ get '/system/foos/images/1/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
47
47
  end
48
48
 
49
49
  should 'find record when an ID partition is used' do
50
50
  @foo.stubs(:image_with_id_partition_in_url).returns @attachment
51
51
  Foo.expects(:find).with(10042).returns @foo
52
52
 
53
- get '/system/foos/image_with_id_partition_in_urls/000/010/042/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
53
+ get '/system/foos/image_with_id_partition_in_urls/000/010/042/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
54
54
  end
55
55
 
56
56
  should 'respond with correct content type' do
57
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
57
+ get '/system/foos/images/1/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
58
58
 
59
59
  assert_equal 'image/jpeg', last_response.header['Content-Type']
60
60
  end
61
61
 
62
62
  should 'respond with correct content-disposition' do
63
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
63
+ get '/system/foos/images/1/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
64
64
 
65
65
  assert_equal 'inline; filename=rails.png', last_response.header['Content-Disposition']
66
66
  end
67
67
 
68
68
  should 'respond with correct content-transfer-encoding' do
69
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
69
+ get '/system/foos/images/1/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
70
70
 
71
71
  assert_equal 'binary', last_response.header['Content-Transfer-Encoding']
72
72
  end
@@ -78,19 +78,19 @@ class DynamicPaperclip::AttachmentStyleGeneratorTest < MiniTest::Unit::TestCase
78
78
  image_file_body = file_body.new(File.join(FIXTURES_DIR, 'rails.png'))
79
79
  file_body.expects(:new).with(File.join(FIXTURES_DIR, 'rails.png')).returns(image_file_body)
80
80
 
81
- response = app.call(Rack::MockRequest.env_for('/system/foos/images/1/dynamic_42x42/rails.png?s='+DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42')))
81
+ response = app.call(Rack::MockRequest.env_for('/system/foos/images/1/dynamic_42x42/file?s='+DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42')))
82
82
 
83
83
  assert_equal image_file_body, response[2]
84
84
  end
85
85
 
86
86
  should 'respond with success' do
87
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
87
+ get '/system/foos/images/1/dynamic_42x42/file', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
88
88
 
89
89
  assert last_response.ok?
90
90
  end
91
91
 
92
92
  should '403 with empty body if hash does not match style name' do
93
- get '/system/foos/images/1/dynamic_42x42/rails.png', { s: 'this is an invalid hash' }
93
+ get '/system/foos/images/1/dynamic_42x42/file', { s: 'this is an invalid hash' }
94
94
 
95
95
  assert_equal 403, last_response.status
96
96
  assert_equal '', last_response.body
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Ryan