s3_relay 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/controllers/s3_relay/uploads_controller.rb +8 -2
  4. data/app/models/s3_relay/upload.rb +1 -1
  5. data/lib/s3_relay/private_url.rb +1 -1
  6. data/lib/s3_relay/version.rb +1 -1
  7. data/test/controllers/s3_relay/uploads_controller_test.rb +17 -11
  8. data/test/dummy/{README.rdoc → README.md} +1 -5
  9. data/test/dummy/Rakefile +1 -1
  10. data/test/dummy/app/assets/config/manifest.js +3 -0
  11. data/test/dummy/app/assets/javascripts/application.js +6 -4
  12. data/test/dummy/app/assets/javascripts/cable.js +13 -0
  13. data/test/dummy/app/assets/stylesheets/application.css +5 -5
  14. data/test/dummy/app/channels/application_cable/channel.rb +4 -0
  15. data/test/dummy/app/channels/application_cable/connection.rb +4 -0
  16. data/test/dummy/app/controllers/application_controller.rb +0 -2
  17. data/test/dummy/app/jobs/application_job.rb +2 -0
  18. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  19. data/test/dummy/app/models/application_record.rb +3 -0
  20. data/test/dummy/app/models/product.rb +1 -1
  21. data/test/dummy/app/views/layouts/application.html.erb +9 -9
  22. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  23. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  24. data/test/dummy/bin/rails +6 -1
  25. data/test/dummy/bin/rake +5 -0
  26. data/test/dummy/bin/setup +38 -0
  27. data/test/dummy/bin/spring +17 -0
  28. data/test/dummy/bin/update +29 -0
  29. data/test/dummy/bin/yarn +11 -0
  30. data/test/dummy/config/application.rb +7 -11
  31. data/test/dummy/config/boot.rb +2 -4
  32. data/test/dummy/config/cable.yml +10 -0
  33. data/test/dummy/config/environment.rb +1 -1
  34. data/test/dummy/config/environments/development.rb +24 -7
  35. data/test/dummy/config/environments/production.rb +35 -22
  36. data/test/dummy/config/environments/test.rb +6 -3
  37. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  38. data/test/dummy/config/initializers/assets.rb +8 -2
  39. data/test/dummy/config/initializers/cookies_serializer.rb +3 -1
  40. data/test/dummy/config/initializers/wrap_parameters.rb +2 -2
  41. data/test/dummy/config/locales/en.yml +10 -0
  42. data/test/dummy/config/puma.rb +56 -0
  43. data/test/dummy/config/secrets.yml +15 -5
  44. data/test/dummy/config/spring.rb +6 -0
  45. data/test/dummy/config.ru +2 -1
  46. data/test/dummy/db/seeds.rb +7 -0
  47. data/test/dummy/package.json +5 -0
  48. data/test/dummy/public/404.html +6 -6
  49. data/test/dummy/public/422.html +6 -6
  50. data/test/dummy/public/500.html +6 -6
  51. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  52. data/test/dummy/public/apple-touch-icon.png +0 -0
  53. data/test/dummy/public/robots.txt +1 -0
  54. data/test/dummy/test/application_system_test_case.rb +5 -0
  55. data/test/dummy/test/test_helper.rb +9 -0
  56. data/test/factories/uploads.rb +10 -3
  57. data/test/helpers/s3_relay/uploads_helper_test.rb +3 -3
  58. data/test/models/s3_relay/upload_test.rb +6 -5
  59. data/test/test_helper.rb +1 -0
  60. metadata +89 -33
  61. data/test/dummy/config/initializers/session_store.rb +0 -3
  62. data/test/dummy/log/development.log +0 -26
  63. data/test/dummy/log/test.log +0 -988
@@ -1,988 +0,0 @@
1
-  (201.5ms) DROP DATABASE IF EXISTS "s3_relay_test"
2
-  (396.9ms) CREATE DATABASE "s3_relay_test" ENCODING = 'unicode'
3
- SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
4
-  (5.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "created_at" timestamp, "updated_at" timestamp)
5
-  (3.4ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '{}', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
6
-  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
7
-  (0.4ms) SELECT version FROM "schema_migrations"
8
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141021002149')
9
-  (2.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
10
- ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
11
-  (0.1ms) BEGIN
12
- SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2016-12-30 06:31:00 UTC], ["updated_at", 2016-12-30 06:31:00 UTC]]
13
-  (0.4ms) COMMIT
14
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
15
-  (0.1ms) BEGIN
16
-  (0.1ms) COMMIT
17
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
18
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
19
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
20
-  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
21
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
22
-  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
23
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
24
-  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
25
-  (173.2ms) DROP DATABASE IF EXISTS "s3_relay_test"
26
-  (397.9ms) CREATE DATABASE "s3_relay_test" ENCODING = 'unicode'
27
- SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
28
-  (4.8ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "created_at" timestamp, "updated_at" timestamp)
29
-  (3.3ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
30
-  (2.5ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
31
-  (0.4ms) SELECT version FROM "schema_migrations"
32
-  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141021002149')
33
-  (2.5ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
34
- ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
35
-  (0.1ms) BEGIN
36
- SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2016-12-30 06:31:27 UTC], ["updated_at", 2016-12-30 06:31:27 UTC]]
37
-  (0.4ms) COMMIT
38
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
39
-  (0.1ms) BEGIN
40
-  (0.1ms) COMMIT
41
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
42
-  (0.2ms) SELECT pg_try_advisory_lock(5551432892130617310);
43
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
44
- Migrating to CreateS3RelayUploads (20141009000804)
45
-  (0.1ms) BEGIN
46
-  (4.7ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
47
-  (0.1ms) ROLLBACK
48
-  (0.2ms) SELECT pg_advisory_unlock(5551432892130617310)
49
-  (0.2ms) SELECT pg_try_advisory_lock(5551432892130617310);
50
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
51
- Migrating to CreateS3RelayUploads (20141009000804)
52
-  (0.1ms) BEGIN
53
-  (3.1ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
54
-  (0.1ms) ROLLBACK
55
-  (0.3ms) SELECT pg_advisory_unlock(5551432892130617310)
56
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
57
-  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
58
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
59
-  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
60
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
61
-  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
62
- SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
63
-  (4.1ms) DROP TABLE "products" CASCADE
64
-  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "created_at" timestamp, "updated_at" timestamp)
65
-  (1.7ms) DROP TABLE "s3_relay_uploads" CASCADE
66
-  (3.2ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
67
-  (0.4ms) SELECT version FROM "schema_migrations"
68
-  (0.7ms) INSERT INTO schema_migrations (version) VALUES
69
- ('20141009000804');
70
-
71
- 
72
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
73
-  (0.1ms) BEGIN
74
-  (0.4ms) COMMIT
75
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
76
-  (0.1ms) BEGIN
77
-  (0.1ms) COMMIT
78
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
79
-  (0.1ms) BEGIN
80
-  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
81
-  (0.1ms) COMMIT
82
-  (1.1ms)  SELECT schemaname || '.' || tablename
83
- FROM pg_tables
84
- WHERE
85
- tablename !~ '_prt_' AND
86
- tablename <> 'schema_migrations' AND
87
- schemaname = ANY (current_schemas(false))
88
- 
89
-  (0.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
90
-  (9.6ms) TRUNCATE TABLE "public"."ar_internal_metadata", "public"."products", "public"."s3_relay_uploads" RESTART IDENTITY CASCADE;
91
-  (0.3ms) BEGIN
92
-  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
93
-  (0.1ms) COMMIT
94
-  (0.2ms) BEGIN
95
-  (0.1ms) COMMIT
96
-  (0.1ms) BEGIN
97
-  (0.1ms) ROLLBACK
98
-  (0.1ms) BEGIN
99
- -----------------------------------------------------
100
- S3Relay::Upload::scopes::pending: test_0001_anonymous
101
- -----------------------------------------------------
102
-  (0.2ms) SAVEPOINT active_record_1
103
- SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "pending"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
104
-  (0.1ms) RELEASE SAVEPOINT active_record_1
105
-  (0.1ms) SAVEPOINT active_record_1
106
- SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "imported"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
107
-  (0.1ms) RELEASE SAVEPOINT active_record_1
108
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = $1 [["state", "pending"]]
109
-  (0.1ms) ROLLBACK
110
-  (0.1ms) BEGIN
111
- -----------------------------------------------------------------------
112
- S3Relay::Upload::validations::upload_type: test_0001_validates presence
113
- -----------------------------------------------------------------------
114
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
115
-  (0.1ms) ROLLBACK
116
-  (0.1ms) BEGIN
117
- ---------------------------------------------------------------------------------------------------------------------
118
- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
119
- ---------------------------------------------------------------------------------------------------------------------
120
-  (0.1ms) ROLLBACK
121
-  (0.1ms) BEGIN
122
- --------------------------------------------------
123
- S3Relay::Upload::#private_url: test_0001_anonymous
124
- --------------------------------------------------
125
-  (0.1ms) ROLLBACK
126
-  (0.1ms) BEGIN
127
- ------------------------------------------------------------------------
128
- S3Relay::Upload::validations::content_type: test_0001_validates presence
129
- ------------------------------------------------------------------------
130
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
131
-  (0.1ms) ROLLBACK
132
-  (0.1ms) BEGIN
133
- ----------------------------------------------------------
134
- S3Relay::Upload::associations::parent: test_0001_anonymous
135
- ----------------------------------------------------------
136
-  (0.1ms) ROLLBACK
137
-  (0.1ms) BEGIN
138
-  (0.1ms) COMMIT
139
-  (0.1ms) BEGIN
140
-  (0.1ms) SAVEPOINT active_record_1
141
- SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
142
-  (0.1ms) RELEASE SAVEPOINT active_record_1
143
-  (0.1ms) SAVEPOINT active_record_1
144
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
145
-  (0.1ms) ROLLBACK
146
-  (0.2ms) BEGIN
147
- ---------------------------------------------------------------------------------
148
- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
149
- ---------------------------------------------------------------------------------
150
-  (0.1ms) SAVEPOINT active_record_1
151
- SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
152
-  (0.1ms) RELEASE SAVEPOINT active_record_1
153
-  (0.2ms) ROLLBACK
154
-  (0.1ms) BEGIN
155
- ---------------------------------------------------------------------
156
- S3Relay::UploadsController::POST create::success: test_0001_anonymous
157
- ---------------------------------------------------------------------
158
-  (0.1ms) ROLLBACK
159
-  (0.1ms) BEGIN
160
- -----------------------------------------------------------------------------------
161
- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
162
- -----------------------------------------------------------------------------------
163
-  (0.1ms) SAVEPOINT active_record_1
164
- SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
165
-  (0.1ms) RELEASE SAVEPOINT active_record_1
166
-  (0.1ms) ROLLBACK
167
-  (0.1ms) BEGIN
168
- ----------------------------------------------------------------------
169
- S3Relay::Upload::validations::pending_at: test_0001_validates presence
170
- ----------------------------------------------------------------------
171
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
172
-  (0.1ms) ROLLBACK
173
-  (0.1ms) BEGIN
174
-  (0.1ms) COMMIT
175
-  (0.1ms) BEGIN
176
-  (0.1ms) ROLLBACK
177
-  (0.1ms) BEGIN
178
-  (0.1ms) COMMIT
179
-  (0.1ms) BEGIN
180
-  (0.1ms) ROLLBACK
181
-  (0.1ms) BEGIN
182
-  (0.1ms) COMMIT
183
-  (0.1ms) BEGIN
184
-  (0.1ms) ROLLBACK
185
-  (0.2ms) BEGIN
186
-  (0.1ms) COMMIT
187
-  (0.1ms) BEGIN
188
-  (0.1ms) SAVEPOINT active_record_1
189
- SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
190
-  (0.1ms) RELEASE SAVEPOINT active_record_1
191
-  (0.1ms) SAVEPOINT active_record_1
192
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
193
-  (0.1ms) ROLLBACK
194
-  (0.2ms) BEGIN
195
- -----------------------------------------------
196
- S3Relay::Upload::#pending?: test_0001_anonymous
197
- -----------------------------------------------
198
-  (0.1ms) ROLLBACK
199
-  (0.2ms) BEGIN
200
- -----------------------------------------------
201
- S3Relay::Upload::#imported: test_0001_anonymous
202
- -----------------------------------------------
203
-  (0.1ms) ROLLBACK
204
-  (0.1ms) BEGIN
205
- -----------------------------------------------------------------------------
206
- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
207
- -----------------------------------------------------------------------------
208
-  (0.1ms) SAVEPOINT active_record_1
209
- SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
210
-  (0.1ms) RELEASE SAVEPOINT active_record_1
211
-  (0.3ms) ROLLBACK
212
-  (0.2ms) BEGIN
213
- ------------------------------------------------------
214
- S3Relay::Upload::scopes::imported: test_0001_anonymous
215
- ------------------------------------------------------
216
-  (0.2ms) SAVEPOINT active_record_1
217
- SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "pending"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
218
-  (0.1ms) RELEASE SAVEPOINT active_record_1
219
-  (0.1ms) SAVEPOINT active_record_1
220
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "imported"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
221
-  (0.1ms) RELEASE SAVEPOINT active_record_1
222
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = $1 [["state", "imported"]]
223
-  (0.1ms) ROLLBACK
224
-  (0.1ms) BEGIN
225
-  (0.1ms) COMMIT
226
-  (0.1ms) BEGIN
227
-  (0.1ms) ROLLBACK
228
-  (0.2ms) BEGIN
229
- ------------------------------------------------------------------------------------------
230
- S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
231
- ------------------------------------------------------------------------------------------
232
-  (0.1ms) SAVEPOINT active_record_1
233
- SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
234
-  (0.1ms) RELEASE SAVEPOINT active_record_1
235
-  (0.2ms) ROLLBACK
236
-  (0.1ms) BEGIN
237
- --------------------------------------------------------------------
238
- S3Relay::Upload::validations::filename: test_0001_validates presence
239
- --------------------------------------------------------------------
240
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
241
-  (0.1ms) ROLLBACK
242
-  (0.1ms) BEGIN
243
- --------------------------------------------------------------------------------------------------------------------------------------------
244
- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
245
- --------------------------------------------------------------------------------------------------------------------------------------------
246
-  (0.1ms) ROLLBACK
247
-  (0.1ms) BEGIN
248
- --------------------------------------------------------
249
- S3Relay::UploadsController::GET new: test_0001_anonymous
250
- --------------------------------------------------------
251
-  (0.1ms) ROLLBACK
252
-  (0.1ms) BEGIN
253
- -----------------------------------------------------
254
- S3Relay::Upload::#mark_imported!: test_0001_anonymous
255
- -----------------------------------------------------
256
-  (0.1ms) SAVEPOINT active_record_1
257
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
258
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
259
-  (0.1ms) ROLLBACK
260
-  (0.1ms) BEGIN
261
- -------------------------------------------------------
262
- S3Relay::Upload::upon finalization: test_0001_anonymous
263
- -------------------------------------------------------
264
-  (0.1ms) ROLLBACK
265
-  (0.1ms) BEGIN
266
- ----------------------------------------------------------------
267
- S3Relay::Upload::validations::uuid: test_0001_validates presence
268
- ----------------------------------------------------------------
269
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
270
-  (0.1ms) ROLLBACK
271
-  (0.1ms) BEGIN
272
- ------------------------------------------------------------------
273
- S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
274
- ------------------------------------------------------------------
275
-  (0.1ms) SAVEPOINT active_record_1
276
- SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "pending"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
277
-  (0.3ms) RELEASE SAVEPOINT active_record_1
278
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
279
-  (0.1ms) ROLLBACK
280
-  (0.1ms) BEGIN
281
-  (0.0ms) COMMIT
282
-  (0.0ms) BEGIN
283
-  (0.1ms) SAVEPOINT active_record_1
284
- SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
285
-  (0.1ms) RELEASE SAVEPOINT active_record_1
286
-  (0.1ms) SAVEPOINT active_record_1
287
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
288
-  (0.1ms) ROLLBACK
289
-  (0.1ms) BEGIN
290
- -------------------------------------------------------------------
291
- S3Relay::UploadsController::POST create::error: test_0001_anonymous
292
- -------------------------------------------------------------------
293
-  (0.1ms) ROLLBACK
294
-  (0.1ms) BEGIN
295
- -----------------------------------------------------------------------------------------------------------------
296
- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
297
- -----------------------------------------------------------------------------------------------------------------
298
-  (0.1ms) ROLLBACK
299
- ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
300
-  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
301
-  (1.0ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
302
-  (10.6ms) TRUNCATE TABLE "ar_internal_metadata", "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
303
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
304
-  (0.1ms) BEGIN
305
-  (0.1ms) COMMIT
306
-  (0.1ms) BEGIN
307
-  (0.1ms) SAVEPOINT active_record_1
308
- SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.807336"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.807336"]]
309
-  (0.1ms) RELEASE SAVEPOINT active_record_1
310
-  (0.1ms) SAVEPOINT active_record_1
311
- S3Relay::Upload Exists (2.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
312
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
313
- :format: 1
314
- ' LIMIT 1
315
- SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.831936"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.818698"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.831936"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
316
-  (0.1ms) RELEASE SAVEPOINT active_record_1
317
-  (0.1ms) SAVEPOINT active_record_1
318
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
319
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
320
- :format: 1
321
- ' LIMIT 1
322
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.837536"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.834981"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.837536"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
323
-  (0.1ms) RELEASE SAVEPOINT active_record_1
324
-  (0.1ms) SAVEPOINT active_record_1
325
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
326
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
327
- :format: 1
328
- ' LIMIT 1
329
- SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.840710"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.839167"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.840710"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
330
-  (0.1ms) RELEASE SAVEPOINT active_record_1
331
- S3Relay::Upload Load (0.9ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1
332
-  (0.1ms) ROLLBACK
333
-  (0.1ms) BEGIN
334
- ----------------------------------------------------------------------
335
- S3Relay::Upload::validations::pending_at: test_0001_validates presence
336
- ----------------------------------------------------------------------
337
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
338
-  (0.1ms) ROLLBACK
339
-  (0.1ms) BEGIN
340
- -----------------------------------------------
341
- S3Relay::Upload::#pending?: test_0001_anonymous
342
- -----------------------------------------------
343
-  (0.1ms) ROLLBACK
344
-  (0.1ms) BEGIN
345
- ---------------------------------------------------------------------------------
346
- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
347
- ---------------------------------------------------------------------------------
348
-  (0.1ms) SAVEPOINT active_record_1
349
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.862657"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.862657"]]
350
-  (0.1ms) RELEASE SAVEPOINT active_record_1
351
-  (0.1ms) ROLLBACK
352
-  (0.1ms) BEGIN
353
-  (0.1ms) COMMIT
354
-  (0.1ms) BEGIN
355
-  (0.1ms) SAVEPOINT active_record_1
356
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.866235"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.866235"]]
357
-  (0.1ms) RELEASE SAVEPOINT active_record_1
358
-  (0.1ms) SAVEPOINT active_record_1
359
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
360
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
361
- :format: 1
362
- ' LIMIT 1
363
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.869235"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.867608"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.869235"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
364
-  (0.1ms) RELEASE SAVEPOINT active_record_1
365
-  (0.1ms) SAVEPOINT active_record_1
366
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
367
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
368
- :format: 1
369
- ' LIMIT 1
370
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.872292"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.870845"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.872292"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
371
-  (0.1ms) RELEASE SAVEPOINT active_record_1
372
-  (0.1ms) SAVEPOINT active_record_1
373
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
374
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
375
- :format: 1
376
- ' LIMIT 1
377
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.875168"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.873791"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.875168"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
378
-  (0.1ms) RELEASE SAVEPOINT active_record_1
379
-  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
380
-  (0.1ms) ROLLBACK
381
-  (0.1ms) BEGIN
382
-  (0.1ms) COMMIT
383
-  (0.1ms) BEGIN
384
-  (0.1ms) ROLLBACK
385
-  (0.1ms) BEGIN
386
- --------------------------------------------------------
387
- S3Relay::UploadsController::GET new: test_0001_anonymous
388
- --------------------------------------------------------
389
- Processing by S3Relay::UploadsController#new as HTML
390
- Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
391
-  (0.1ms) ROLLBACK
392
-  (0.1ms) BEGIN
393
- -----------------------------------------------------------------------------
394
- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
395
- -----------------------------------------------------------------------------
396
-  (0.1ms) SAVEPOINT active_record_1
397
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.893511"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.893511"]]
398
-  (0.1ms) RELEASE SAVEPOINT active_record_1
399
-  (0.1ms) ROLLBACK
400
-  (0.1ms) BEGIN
401
- ---------------------------------------------------------------------
402
- S3Relay::UploadsController::POST create::success: test_0001_anonymous
403
- ---------------------------------------------------------------------
404
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
405
- Processing by S3Relay::UploadsController#create as HTML
406
- Parameters: {"association"=>"photo_uploads", "uuid"=>"df927d35-a844-4712-8444-438d2058da38", "filename"=>"cat.png", "content_type"=>"image/png"}
407
-  (0.1ms) SAVEPOINT active_record_1
408
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
409
- :value: df927d35-a844-4712-8444-438d2058da38
410
- :format: 1
411
- ' LIMIT 1
412
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.902055"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.900650"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.902055"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
413
-  (0.1ms) RELEASE SAVEPOINT active_record_1
414
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
415
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
416
-  (0.1ms) ROLLBACK
417
-  (0.1ms) BEGIN
418
- -----------------------------------------------------------------------
419
- S3Relay::Upload::validations::upload_type: test_0001_validates presence
420
- -----------------------------------------------------------------------
421
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
422
-  (0.1ms) ROLLBACK
423
-  (0.1ms) BEGIN
424
- ----------------------------------------------------------------
425
- S3Relay::Upload::validations::uuid: test_0001_validates presence
426
- ----------------------------------------------------------------
427
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
428
-  (0.1ms) ROLLBACK
429
-  (0.1ms) BEGIN
430
- ------------------------------------------------------------------
431
- S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
432
- ------------------------------------------------------------------
433
-  (0.1ms) SAVEPOINT active_record_1
434
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.914403"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.914115"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.914403"]]
435
-  (0.1ms) RELEASE SAVEPOINT active_record_1
436
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
437
-  (0.1ms) ROLLBACK
438
-  (0.1ms) BEGIN
439
- -------------------------------------------------------
440
- S3Relay::Upload::upon finalization: test_0001_anonymous
441
- -------------------------------------------------------
442
-  (0.1ms) ROLLBACK
443
-  (0.1ms) BEGIN
444
- ------------------------------------------------------
445
- S3Relay::Upload::scopes::imported: test_0001_anonymous
446
- ------------------------------------------------------
447
-  (0.1ms) SAVEPOINT active_record_1
448
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.921707"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.921407"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.921707"]]
449
-  (0.1ms) RELEASE SAVEPOINT active_record_1
450
-  (0.1ms) SAVEPOINT active_record_1
451
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.923295"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.923025"], ["state", "imported"], ["updated_at", "2016-12-30 06:50:36.923295"]]
452
-  (0.1ms) RELEASE SAVEPOINT active_record_1
453
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
454
-  (0.1ms) ROLLBACK
455
-  (0.1ms) BEGIN
456
- -----------------------------------------------------
457
- S3Relay::Upload::#mark_imported!: test_0001_anonymous
458
- -----------------------------------------------------
459
-  (0.1ms) SAVEPOINT active_record_1
460
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
461
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
462
-  (0.1ms) ROLLBACK
463
-  (0.1ms) BEGIN
464
-  (0.1ms) COMMIT
465
-  (0.1ms) BEGIN
466
-  (0.1ms) SAVEPOINT active_record_1
467
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.932377"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.932377"]]
468
-  (0.1ms) RELEASE SAVEPOINT active_record_1
469
-  (0.1ms) SAVEPOINT active_record_1
470
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
471
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
472
- :format: 1
473
- ' LIMIT 1
474
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.935135"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.933718"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.935135"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
475
-  (0.1ms) RELEASE SAVEPOINT active_record_1
476
-  (0.1ms) SAVEPOINT active_record_1
477
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
478
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
479
- :format: 1
480
- ' LIMIT 1
481
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.937819"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.936573"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.937819"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
482
-  (0.1ms) RELEASE SAVEPOINT active_record_1
483
-  (0.1ms) SAVEPOINT active_record_1
484
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
485
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
486
- :format: 1
487
- ' LIMIT 1
488
- SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.940505"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.939215"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.940505"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
489
-  (0.1ms) RELEASE SAVEPOINT active_record_1
490
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
491
- SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('b1b5b5e9-157f-415a-892d-1e0e84fcb336', 'b1b5b5e9-157f-415a-892d-1e0e84fcb336') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
492
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
493
-  (0.1ms) ROLLBACK
494
-  (0.2ms) BEGIN
495
- -----------------------------------------------
496
- S3Relay::Upload::#imported: test_0001_anonymous
497
- -----------------------------------------------
498
-  (0.1ms) ROLLBACK
499
-  (0.1ms) BEGIN
500
- -----------------------------------------------------------------------------------------------------------------
501
- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
502
- -----------------------------------------------------------------------------------------------------------------
503
-  (0.1ms) SAVEPOINT active_record_1
504
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.949745"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.949745"]]
505
-  (0.1ms) RELEASE SAVEPOINT active_record_1
506
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
507
- Processing by S3Relay::UploadsController#create as HTML
508
- Parameters: {"association"=>"photo_uploads", "uuid"=>"2b478a2e-e6e2-49f6-a226-e375fd58541f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"6"}
509
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 6 LIMIT 1
510
-  (0.1ms) SAVEPOINT active_record_1
511
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
512
- :value: 2b478a2e-e6e2-49f6-a226-e375fd58541f
513
- :format: 1
514
- ' LIMIT 1
515
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.956132"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.954605"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.956132"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
516
-  (0.1ms) RELEASE SAVEPOINT active_record_1
517
- Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)
518
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
519
-  (0.1ms) ROLLBACK
520
-  (0.1ms) BEGIN
521
- -----------------------------------------------------
522
- S3Relay::Upload::scopes::pending: test_0001_anonymous
523
- -----------------------------------------------------
524
-  (0.1ms) SAVEPOINT active_record_1
525
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.961353"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.961050"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.961353"]]
526
-  (0.1ms) RELEASE SAVEPOINT active_record_1
527
-  (0.1ms) SAVEPOINT active_record_1
528
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.962869"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.962621"], ["state", "imported"], ["updated_at", "2016-12-30 06:50:36.962869"]]
529
-  (0.1ms) RELEASE SAVEPOINT active_record_1
530
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'
531
-  (0.1ms) ROLLBACK
532
-  (0.1ms) BEGIN
533
- --------------------------------------------------------------------
534
- S3Relay::Upload::validations::filename: test_0001_validates presence
535
- --------------------------------------------------------------------
536
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
537
-  (0.1ms) ROLLBACK
538
-  (0.1ms) BEGIN
539
-  (0.1ms) COMMIT
540
-  (0.1ms) BEGIN
541
-  (0.1ms) ROLLBACK
542
-  (0.1ms) BEGIN
543
-  (0.1ms) COMMIT
544
-  (0.1ms) BEGIN
545
-  (0.1ms) ROLLBACK
546
-  (0.1ms) BEGIN
547
- ---------------------------------------------------------------------------------------------------------------------
548
- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
549
- ---------------------------------------------------------------------------------------------------------------------
550
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
551
- Processing by S3Relay::UploadsController#create as HTML
552
- Parameters: {"association"=>"photo_uploads", "uuid"=>"58cd1837-8d87-4dca-ae7e-c612080d5380", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
553
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
554
-  (0.1ms) SAVEPOINT active_record_1
555
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
556
- :value: 58cd1837-8d87-4dca-ae7e-c612080d5380
557
- :format: 1
558
- ' LIMIT 1
559
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.978191"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.976949"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.978191"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
560
-  (0.1ms) RELEASE SAVEPOINT active_record_1
561
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.8ms)
562
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
563
-  (0.1ms) ROLLBACK
564
-  (0.1ms) BEGIN
565
- --------------------------------------------------
566
- S3Relay::Upload::#private_url: test_0001_anonymous
567
- --------------------------------------------------
568
-  (0.1ms) ROLLBACK
569
-  (0.1ms) BEGIN
570
- -------------------------------------------------------------------
571
- S3Relay::UploadsController::POST create::error: test_0001_anonymous
572
- -------------------------------------------------------------------
573
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
574
- Processing by S3Relay::UploadsController#create as HTML
575
- Parameters: {"uuid"=>"8fc5811d-89be-4a64-a33c-eddd4d328915", "filename"=>"cat.png", "content_type"=>"image/png"}
576
-  (0.1ms) SAVEPOINT active_record_1
577
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
578
- :value: 8fc5811d-89be-4a64-a33c-eddd4d328915
579
- :format: 1
580
- ' LIMIT 1
581
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
582
- Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.4ms)
583
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
584
-  (0.2ms) ROLLBACK
585
-  (0.1ms) BEGIN
586
- -----------------------------------------------------------------------------------
587
- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
588
- -----------------------------------------------------------------------------------
589
-  (0.1ms) SAVEPOINT active_record_1
590
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.995144"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.995144"]]
591
-  (0.1ms) RELEASE SAVEPOINT active_record_1
592
-  (0.1ms) SAVEPOINT active_record_1
593
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
594
- :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
595
- :format: 1
596
- ' LIMIT 1
597
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.997828"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.994468"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.997828"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
598
-  (0.1ms) RELEASE SAVEPOINT active_record_1
599
-  (0.1ms) ROLLBACK
600
-  (0.1ms) BEGIN
601
- ----------------------------------------------------------
602
- S3Relay::Upload::associations::parent: test_0001_anonymous
603
- ----------------------------------------------------------
604
-  (0.1ms) ROLLBACK
605
-  (0.1ms) BEGIN
606
- ------------------------------------------------------------------------------------------
607
- S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
608
- ------------------------------------------------------------------------------------------
609
-  (0.1ms) SAVEPOINT active_record_1
610
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:37.005434"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:37.005434"]]
611
-  (0.1ms) RELEASE SAVEPOINT active_record_1
612
-  (0.1ms) ROLLBACK
613
-  (0.1ms) BEGIN
614
- ------------------------------------------------------------------------
615
- S3Relay::Upload::validations::content_type: test_0001_validates presence
616
- ------------------------------------------------------------------------
617
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
618
-  (0.1ms) ROLLBACK
619
-  (0.1ms) BEGIN
620
-  (0.1ms) COMMIT
621
-  (0.1ms) BEGIN
622
-  (0.1ms) ROLLBACK
623
-  (0.1ms) BEGIN
624
-  (0.1ms) COMMIT
625
-  (0.1ms) BEGIN
626
-  (0.1ms) ROLLBACK
627
-  (0.1ms) BEGIN
628
- --------------------------------------------------------------------------------------------------------------------------------------------
629
- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
630
- --------------------------------------------------------------------------------------------------------------------------------------------
631
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
632
- Processing by S3Relay::UploadsController#create as HTML
633
- Parameters: {"association"=>"photo_uploads", "uuid"=>"ba73948c-98f3-4e82-baa4-ec8654cd4439", "filename"=>"cat.png", "content_type"=>"image/png"}
634
-  (0.1ms) SAVEPOINT active_record_1
635
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
636
- :value: ba73948c-98f3-4e82-baa4-ec8654cd4439
637
- :format: 1
638
- ' LIMIT 1
639
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:37.021286"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:37.019924"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:37.021286"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
640
-  (0.1ms) RELEASE SAVEPOINT active_record_1
641
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
642
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
643
-  (0.1ms) ROLLBACK
644
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
645
-  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
646
-  (0.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
647
-  (9.5ms) TRUNCATE TABLE "ar_internal_metadata", "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
648
-  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
649
-  (0.2ms) BEGIN
650
- -------------------------------------------------------------------
651
- S3Relay::UploadsController::POST create::error: test_0001_anonymous
652
- -------------------------------------------------------------------
653
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
654
- Processing by S3Relay::UploadsController#create as HTML
655
- Parameters: {"uuid"=>"5fb67309-12b1-4abb-bd45-edcaa78eeba2", "filename"=>"cat.png", "content_type"=>"image/png"}
656
-  (0.1ms) SAVEPOINT active_record_1
657
- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
658
- :value: 5fb67309-12b1-4abb-bd45-edcaa78eeba2
659
- :format: 1
660
- ' LIMIT 1
661
-  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
662
- Completed 422 Unprocessable Entity in 26ms (Views: 0.2ms | ActiveRecord: 0.7ms)
663
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
664
-  (0.1ms) ROLLBACK
665
-  (0.1ms) BEGIN
666
-  (0.1ms) COMMIT
667
-  (0.0ms) BEGIN
668
-  (0.1ms) SAVEPOINT active_record_1
669
- SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.367700"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.367700"]]
670
-  (0.1ms) RELEASE SAVEPOINT active_record_1
671
-  (0.1ms) SAVEPOINT active_record_1
672
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
673
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
674
- :format: 1
675
- ' LIMIT 1
676
- SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.375464"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.370188"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.375464"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
677
-  (0.1ms) RELEASE SAVEPOINT active_record_1
678
-  (0.1ms) SAVEPOINT active_record_1
679
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
680
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
681
- :format: 1
682
- ' LIMIT 1
683
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.379096"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.377637"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.379096"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
684
-  (0.1ms) RELEASE SAVEPOINT active_record_1
685
-  (0.1ms) SAVEPOINT active_record_1
686
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
687
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
688
- :format: 1
689
- ' LIMIT 1
690
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.382026"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.380642"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.382026"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
691
-  (0.1ms) RELEASE SAVEPOINT active_record_1
692
- S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1
693
-  (0.1ms) ROLLBACK
694
-  (0.1ms) BEGIN
695
- ------------------------------------------------------------------------------------------
696
- S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
697
- ------------------------------------------------------------------------------------------
698
-  (0.1ms) SAVEPOINT active_record_1
699
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.389932"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.389932"]]
700
-  (0.1ms) RELEASE SAVEPOINT active_record_1
701
-  (0.1ms) ROLLBACK
702
-  (0.1ms) BEGIN
703
- -----------------------------------------------------------------------
704
- S3Relay::Upload::validations::upload_type: test_0001_validates presence
705
- -----------------------------------------------------------------------
706
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
707
-  (0.1ms) ROLLBACK
708
-  (0.1ms) BEGIN
709
- --------------------------------------------------------------------------------------------------------------------------------------------
710
- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
711
- --------------------------------------------------------------------------------------------------------------------------------------------
712
-  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
713
- Processing by S3Relay::UploadsController#create as HTML
714
- Parameters: {"association"=>"photo_uploads", "uuid"=>"eb4ec2ad-917c-46cd-a1f2-f7ebd02e3372", "filename"=>"cat.png", "content_type"=>"image/png"}
715
-  (0.1ms) SAVEPOINT active_record_1
716
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
717
- :value: eb4ec2ad-917c-46cd-a1f2-f7ebd02e3372
718
- :format: 1
719
- ' LIMIT 1
720
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.403899"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.402479"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.403899"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
721
-  (0.1ms) RELEASE SAVEPOINT active_record_1
722
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
723
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
724
-  (0.1ms) ROLLBACK
725
-  (0.1ms) BEGIN
726
- --------------------------------------------------------
727
- S3Relay::UploadsController::GET new: test_0001_anonymous
728
- --------------------------------------------------------
729
- Processing by S3Relay::UploadsController#new as HTML
730
- Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
731
-  (0.1ms) ROLLBACK
732
-  (0.1ms) BEGIN
733
- ----------------------------------------------------------------------
734
- S3Relay::Upload::validations::pending_at: test_0001_validates presence
735
- ----------------------------------------------------------------------
736
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
737
-  (0.1ms) ROLLBACK
738
-  (0.1ms) BEGIN
739
- -----------------------------------------------------------------------------------------------------------------
740
- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
741
- -----------------------------------------------------------------------------------------------------------------
742
-  (0.1ms) SAVEPOINT active_record_1
743
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.422753"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.422753"]]
744
-  (0.1ms) RELEASE SAVEPOINT active_record_1
745
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
746
- Processing by S3Relay::UploadsController#create as HTML
747
- Parameters: {"association"=>"photo_uploads", "uuid"=>"596ed5c9-b7d1-48ea-83bc-dcdb0d96a21f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"3"}
748
- Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 3 LIMIT 1
749
-  (0.1ms) SAVEPOINT active_record_1
750
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
751
- :value: 596ed5c9-b7d1-48ea-83bc-dcdb0d96a21f
752
- :format: 1
753
- ' LIMIT 1
754
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.429364"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.427662"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.429364"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
755
-  (0.1ms) RELEASE SAVEPOINT active_record_1
756
- Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)
757
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
758
-  (0.1ms) ROLLBACK
759
-  (0.1ms) BEGIN
760
- -----------------------------------------------------
761
- S3Relay::Upload::scopes::pending: test_0001_anonymous
762
- -----------------------------------------------------
763
-  (0.1ms) SAVEPOINT active_record_1
764
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.434385"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.434073"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.434385"]]
765
-  (0.1ms) RELEASE SAVEPOINT active_record_1
766
-  (0.1ms) SAVEPOINT active_record_1
767
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.436014"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.435765"], ["state", "imported"], ["updated_at", "2016-12-30 07:06:22.436014"]]
768
-  (0.1ms) RELEASE SAVEPOINT active_record_1
769
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'
770
-  (0.1ms) ROLLBACK
771
-  (0.1ms) BEGIN
772
- -----------------------------------------------------------------------------------
773
- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
774
- -----------------------------------------------------------------------------------
775
-  (0.1ms) SAVEPOINT active_record_1
776
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.440751"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.440751"]]
777
-  (0.1ms) RELEASE SAVEPOINT active_record_1
778
-  (0.1ms) SAVEPOINT active_record_1
779
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
780
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
781
- :format: 1
782
- ' LIMIT 1
783
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.443534"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.440076"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.443534"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
784
-  (0.1ms) RELEASE SAVEPOINT active_record_1
785
-  (0.1ms) ROLLBACK
786
-  (0.1ms) BEGIN
787
- --------------------------------------------------
788
- S3Relay::Upload::#private_url: test_0001_anonymous
789
- --------------------------------------------------
790
-  (0.1ms) ROLLBACK
791
-  (0.1ms) BEGIN
792
-  (0.1ms) COMMIT
793
-  (0.1ms) BEGIN
794
-  (0.1ms) ROLLBACK
795
-  (0.1ms) BEGIN
796
-  (0.1ms) COMMIT
797
-  (0.1ms) BEGIN
798
-  (0.1ms) ROLLBACK
799
-  (0.1ms) BEGIN
800
-  (0.1ms) COMMIT
801
-  (0.1ms) BEGIN
802
-  (0.1ms) SAVEPOINT active_record_1
803
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.452610"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.452610"]]
804
-  (0.1ms) RELEASE SAVEPOINT active_record_1
805
-  (0.1ms) SAVEPOINT active_record_1
806
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
807
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
808
- :format: 1
809
- ' LIMIT 1
810
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.455599"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.454031"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.455599"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
811
-  (0.1ms) RELEASE SAVEPOINT active_record_1
812
-  (0.1ms) SAVEPOINT active_record_1
813
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
814
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
815
- :format: 1
816
- ' LIMIT 1
817
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.458536"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.457100"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.458536"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
818
-  (0.1ms) RELEASE SAVEPOINT active_record_1
819
-  (0.1ms) SAVEPOINT active_record_1
820
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
821
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
822
- :format: 1
823
- ' LIMIT 1
824
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.461628"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.460071"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.461628"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
825
-  (0.1ms) RELEASE SAVEPOINT active_record_1
826
-  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
827
-  (0.1ms) ROLLBACK
828
-  (0.1ms) BEGIN
829
- -----------------------------------------------
830
- S3Relay::Upload::#imported: test_0001_anonymous
831
- -----------------------------------------------
832
-  (0.1ms) ROLLBACK
833
-  (0.1ms) BEGIN
834
-  (0.1ms) COMMIT
835
-  (0.1ms) BEGIN
836
-  (0.1ms) SAVEPOINT active_record_1
837
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.467945"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.467945"]]
838
-  (0.1ms) RELEASE SAVEPOINT active_record_1
839
-  (0.1ms) SAVEPOINT active_record_1
840
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
841
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
842
- :format: 1
843
- ' LIMIT 1
844
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.470639"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.469260"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.470639"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
845
-  (0.1ms) RELEASE SAVEPOINT active_record_1
846
-  (0.1ms) SAVEPOINT active_record_1
847
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
848
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
849
- :format: 1
850
- ' LIMIT 1
851
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.473469"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.472182"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.473469"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
852
-  (0.1ms) RELEASE SAVEPOINT active_record_1
853
-  (0.1ms) SAVEPOINT active_record_1
854
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
855
- :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
856
- :format: 1
857
- ' LIMIT 1
858
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.476073"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.474875"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.476073"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
859
-  (0.1ms) RELEASE SAVEPOINT active_record_1
860
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
861
- SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 6 WHERE "s3_relay_uploads"."uuid" IN ('a7c0133c-3182-4f79-a1a5-4eb1276e28d2', 'a7c0133c-3182-4f79-a1a5-4eb1276e28d2') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
862
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
863
-  (0.1ms) ROLLBACK
864
-  (0.1ms) BEGIN
865
-  (0.1ms) COMMIT
866
-  (0.1ms) BEGIN
867
-  (0.1ms) ROLLBACK
868
-  (0.1ms) BEGIN
869
- -----------------------------------------------
870
- S3Relay::Upload::#pending?: test_0001_anonymous
871
- -----------------------------------------------
872
-  (0.1ms) ROLLBACK
873
-  (0.1ms) BEGIN
874
- --------------------------------------------------------------------
875
- S3Relay::Upload::validations::filename: test_0001_validates presence
876
- --------------------------------------------------------------------
877
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
878
-  (0.1ms) ROLLBACK
879
-  (0.1ms) BEGIN
880
-  (0.1ms) COMMIT
881
-  (0.1ms) BEGIN
882
-  (0.2ms) ROLLBACK
883
-  (0.1ms) BEGIN
884
- ---------------------------------------------------------------------------------
885
- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
886
- ---------------------------------------------------------------------------------
887
-  (0.1ms) SAVEPOINT active_record_1
888
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.492146"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.492146"]]
889
-  (0.1ms) RELEASE SAVEPOINT active_record_1
890
-  (0.1ms) ROLLBACK
891
-  (0.1ms) BEGIN
892
- ---------------------------------------------------------------------
893
- S3Relay::UploadsController::POST create::success: test_0001_anonymous
894
- ---------------------------------------------------------------------
895
-  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
896
- Processing by S3Relay::UploadsController#create as HTML
897
- Parameters: {"association"=>"photo_uploads", "uuid"=>"b297276c-e024-4391-a5a5-b71fc5199c25", "filename"=>"cat.png", "content_type"=>"image/png"}
898
-  (0.1ms) SAVEPOINT active_record_1
899
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
900
- :value: b297276c-e024-4391-a5a5-b71fc5199c25
901
- :format: 1
902
- ' LIMIT 1
903
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.501753"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.500393"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.501753"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
904
-  (0.1ms) RELEASE SAVEPOINT active_record_1
905
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
906
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
907
-  (0.1ms) ROLLBACK
908
-  (0.1ms) BEGIN
909
- ----------------------------------------------------------------
910
- S3Relay::Upload::validations::uuid: test_0001_validates presence
911
- ----------------------------------------------------------------
912
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
913
-  (0.1ms) ROLLBACK
914
-  (0.1ms) BEGIN
915
- ------------------------------------------------------------------
916
- S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
917
- ------------------------------------------------------------------
918
-  (0.1ms) SAVEPOINT active_record_1
919
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.509229"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.508956"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.509229"]]
920
-  (0.1ms) RELEASE SAVEPOINT active_record_1
921
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
922
-  (0.2ms) ROLLBACK
923
-  (0.1ms) BEGIN
924
- ------------------------------------------------------
925
- S3Relay::Upload::scopes::imported: test_0001_anonymous
926
- ------------------------------------------------------
927
-  (0.1ms) SAVEPOINT active_record_1
928
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.515073"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.514743"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.515073"]]
929
-  (0.1ms) RELEASE SAVEPOINT active_record_1
930
-  (0.1ms) SAVEPOINT active_record_1
931
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.516566"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.516321"], ["state", "imported"], ["updated_at", "2016-12-30 07:06:22.516566"]]
932
-  (0.1ms) RELEASE SAVEPOINT active_record_1
933
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
934
-  (0.1ms) ROLLBACK
935
-  (0.1ms) BEGIN
936
-  (0.1ms) COMMIT
937
-  (0.1ms) BEGIN
938
-  (0.1ms) ROLLBACK
939
-  (0.2ms) BEGIN
940
- -----------------------------------------------------------------------------
941
- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
942
- -----------------------------------------------------------------------------
943
-  (0.1ms) SAVEPOINT active_record_1
944
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.525326"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.525326"]]
945
-  (0.1ms) RELEASE SAVEPOINT active_record_1
946
-  (0.1ms) ROLLBACK
947
-  (0.1ms) BEGIN
948
- ---------------------------------------------------------------------------------------------------------------------
949
- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
950
- ---------------------------------------------------------------------------------------------------------------------
951
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
952
- Processing by S3Relay::UploadsController#create as HTML
953
- Parameters: {"association"=>"photo_uploads", "uuid"=>"1d707eb2-1f02-4a89-ad8e-4d467a3e28ce", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
954
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
955
-  (0.1ms) SAVEPOINT active_record_1
956
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
957
- :value: 1d707eb2-1f02-4a89-ad8e-4d467a3e28ce
958
- :format: 1
959
- ' LIMIT 1
960
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.533979"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.532714"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.533979"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
961
-  (0.1ms) RELEASE SAVEPOINT active_record_1
962
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)
963
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
964
-  (0.1ms) ROLLBACK
965
-  (0.1ms) BEGIN
966
- -------------------------------------------------------
967
- S3Relay::Upload::upon finalization: test_0001_anonymous
968
- -------------------------------------------------------
969
-  (0.1ms) ROLLBACK
970
-  (0.1ms) BEGIN
971
- ------------------------------------------------------------------------
972
- S3Relay::Upload::validations::content_type: test_0001_validates presence
973
- ------------------------------------------------------------------------
974
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
975
-  (0.1ms) ROLLBACK
976
-  (0.1ms) BEGIN
977
- ----------------------------------------------------------
978
- S3Relay::Upload::associations::parent: test_0001_anonymous
979
- ----------------------------------------------------------
980
-  (0.1ms) ROLLBACK
981
-  (0.1ms) BEGIN
982
- -----------------------------------------------------
983
- S3Relay::Upload::#mark_imported!: test_0001_anonymous
984
- -----------------------------------------------------
985
-  (0.1ms) SAVEPOINT active_record_1
986
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
987
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
988
-  (0.1ms) ROLLBACK