human_urls 0.1.5.pre.alpha.0 → 0.1.6.pre.alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/human_urls/sluggable.rb +1 -1
- data/lib/human_urls/version.rb +1 -1
- data/test/dummy/log/test.log +409 -0
- data/test/dummy/tmp/generators/db/migrate/{20160701172813_add_slug_to_posts.rb → 20161231060814_add_slug_to_posts.rb} +0 -0
- data/test/human_urls/sluggable_test.rb +6 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7028557dc2e2a28527db98145c56934107f5c22
|
4
|
+
data.tar.gz: 91a3070ba4e35b86aee270d22ab7aaaf3b586dfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 219e7a809e8cca50015d6cf9a8b333475bd35a8a82706b6e15bd610b50df472da72dddb0cb7ee77a2e9bd91a6a912a6a4c7ebaca562fea7a1a59c1141a1c78d8
|
7
|
+
data.tar.gz: a1eac4cb08992f096be8f8ec8ca987e7b35b3d6ff2d67485e88bfec16aabfc28c70d9180d036e2e03ed8904253015d56dd3678c5978b64b648f83f564fa360a8
|
data/lib/human_urls/sluggable.rb
CHANGED
@@ -10,7 +10,7 @@ module HumanUrls
|
|
10
10
|
module ClassMethods
|
11
11
|
def sluggify(slug_param=:slug, generated_from: false)
|
12
12
|
validates_presence_of slug_param
|
13
|
-
validates_uniqueness_of slug_param
|
13
|
+
validates_uniqueness_of slug_param, case_sensitive: false
|
14
14
|
validates_length_of slug_param, maximum: 244
|
15
15
|
|
16
16
|
define_method(:to_param) do
|
data/lib/human_urls/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -6216,5 +6216,414 @@ SluggableTest: test_#to_param_returns_the_slug
|
|
6216
6216
|
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6217
6217
|
-------------------------
|
6218
6218
|
HumanUrlsTest: test_truth
|
6219
|
+
-------------------------
|
6220
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6221
|
+
[1m[36mActiveRecord::SchemaMigration Load (4.6ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
6222
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6223
|
+
------------------------------------------------------------------------------
|
6224
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration
|
6225
|
+
------------------------------------------------------------------------------
|
6226
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
6227
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6228
|
+
------------------------------------------------------------------------------------------------------------
|
6229
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration_when_using_custom_slug_column
|
6230
|
+
------------------------------------------------------------------------------------------------------------
|
6231
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
6232
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6233
|
+
-------------------------
|
6234
|
+
HumanUrlsTest: test_truth
|
6235
|
+
-------------------------
|
6236
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6237
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6238
|
+
----------------------------------------------
|
6239
|
+
SluggableTest: test_#to_param_returns_the_slug
|
6240
|
+
----------------------------------------------
|
6241
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6242
|
+
[1m[36mTaggable Exists (4.3ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "slug"], ["LIMIT", 1]]
|
6243
|
+
[1m[35mSQL (4.3ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "slug"], ["created_at", 2016-12-31 05:55:31 UTC], ["updated_at", 2016-12-31 05:55:31 UTC]]
|
6244
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6245
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6246
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6247
|
+
------------------------------------------------
|
6248
|
+
SluggableTest: test_validates_uniqueness_of_slug
|
6249
|
+
------------------------------------------------
|
6250
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6251
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6252
|
+
[1m[35mSQL (0.9ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slug"], ["created_at", 2016-12-31 05:55:31 UTC], ["updated_at", 2016-12-31 05:55:31 UTC]]
|
6253
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6254
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6255
|
+
[1m[36mTaggable Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6256
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6257
|
+
[1m[35m (2.3ms)[0m [1m[31mROLLBACK[0m
|
6258
|
+
[1m[35m (0.8ms)[0m [1m[35mBEGIN[0m
|
6259
|
+
-----------------------------------------------------------------------------------
|
6260
|
+
SluggableTest: test_slug_does_not_update_an_existing_slug_when_source_field_changes
|
6261
|
+
-----------------------------------------------------------------------------------
|
6262
|
+
[1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6263
|
+
[1m[36mTaggableWGeneratedSlug Exists (2.2ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6264
|
+
[1m[35mSQL (1.9ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 05:55:31 UTC], ["updated_at", 2016-12-31 05:55:31 UTC]]
|
6265
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6266
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6267
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-old-slug"], ["id", 97], ["LIMIT", 1]]
|
6268
|
+
[1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "title" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["title", "Changed Title"], ["updated_at", 2016-12-31 05:55:31 UTC], ["id", 97]]
|
6269
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6270
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6271
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6272
|
+
------------------------------------------------------------------------------
|
6273
|
+
SluggableTest: test_slug_properly_updates_an_existing_slug_when_auto_generated
|
6274
|
+
------------------------------------------------------------------------------
|
6275
|
+
[1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6276
|
+
[1m[36mTaggableWGeneratedSlug Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6277
|
+
[1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 05:55:31 UTC], ["updated_at", 2016-12-31 05:55:31 UTC]]
|
6278
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6279
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6280
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-new-slug"], ["id", 98], ["LIMIT", 1]]
|
6281
|
+
[1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-new-slug"], ["updated_at", 2016-12-31 05:55:31 UTC], ["id", 98]]
|
6282
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6283
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6284
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-title"], ["id", 98], ["LIMIT", 1]]
|
6285
|
+
[1m[35mSQL (0.5ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-title"], ["updated_at", 2016-12-31 05:55:31 UTC], ["id", 98]]
|
6286
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6287
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6288
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6289
|
+
----------------------------------------------
|
6290
|
+
SluggableTest: test_validates_presence_of_slug
|
6291
|
+
----------------------------------------------
|
6292
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6293
|
+
[1m[36mTaggable Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", ""], ["LIMIT", 1]]
|
6294
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6295
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6296
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6297
|
+
------------------------------------------------------------------------
|
6298
|
+
SluggableTest: test_slug_properly_formats_string_to_slug_friendly_format
|
6299
|
+
------------------------------------------------------------------------
|
6300
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6301
|
+
[1m[36mTaggable Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "this-i-my-slug"], ["LIMIT", 1]]
|
6302
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "this-i-my-slug"], ["created_at", 2016-12-31 05:55:31 UTC], ["updated_at", 2016-12-31 05:55:31 UTC]]
|
6303
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6304
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6305
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6306
|
+
--------------------------------------------------------------------
|
6307
|
+
SluggableTest: test_.sluggify_can_generate_slug_from_given_attribute
|
6308
|
+
--------------------------------------------------------------------
|
6309
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6310
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-title"], ["LIMIT", 1]]
|
6311
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "My Title"], ["slug", "my-title"], ["created_at", 2016-12-31 05:55:31 UTC], ["updated_at", 2016-12-31 05:55:31 UTC]]
|
6312
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6313
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6314
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.9ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
6315
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6316
|
+
------------------------------------------------------------------------------
|
6317
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration
|
6318
|
+
------------------------------------------------------------------------------
|
6319
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6320
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6321
|
+
------------------------------------------------------------------------------------------------------------
|
6322
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration_when_using_custom_slug_column
|
6323
|
+
------------------------------------------------------------------------------------------------------------
|
6324
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6325
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6326
|
+
-------------------------
|
6327
|
+
HumanUrlsTest: test_truth
|
6328
|
+
-------------------------
|
6329
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6330
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6331
|
+
------------------------------------------------------------------------
|
6332
|
+
SluggableTest: test_slug_properly_formats_string_to_slug_friendly_format
|
6333
|
+
------------------------------------------------------------------------
|
6334
|
+
[1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6335
|
+
[1m[36mTaggable Exists (2.0ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "this-i-my-slug"], ["LIMIT", 1]]
|
6336
|
+
[1m[35mSQL (2.6ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "this-i-my-slug"], ["created_at", 2016-12-31 06:03:40 UTC], ["updated_at", 2016-12-31 06:03:40 UTC]]
|
6337
|
+
[1m[35m (0.4ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6338
|
+
[1m[35m (0.7ms)[0m [1m[31mROLLBACK[0m
|
6339
|
+
[1m[35m (0.4ms)[0m [1m[35mBEGIN[0m
|
6340
|
+
--------------------------------------------------------
|
6341
|
+
SluggableTest: test_validates_case_insensitivity_of_slug
|
6342
|
+
--------------------------------------------------------
|
6343
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6344
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6345
|
+
[1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slug"], ["created_at", 2016-12-31 06:03:40 UTC], ["updated_at", 2016-12-31 06:03:40 UTC]]
|
6346
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6347
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6348
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6349
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6350
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6351
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6352
|
+
------------------------------------------------------------------------------
|
6353
|
+
SluggableTest: test_slug_properly_updates_an_existing_slug_when_auto_generated
|
6354
|
+
------------------------------------------------------------------------------
|
6355
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6356
|
+
[1m[36mTaggableWGeneratedSlug Exists (1.0ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6357
|
+
[1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 06:03:41 UTC], ["updated_at", 2016-12-31 06:03:41 UTC]]
|
6358
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6359
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6360
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-new-slug"], ["id", 100], ["LIMIT", 1]]
|
6361
|
+
[1m[35mSQL (0.9ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-new-slug"], ["updated_at", 2016-12-31 06:03:41 UTC], ["id", 100]]
|
6362
|
+
[1m[35m (0.4ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6363
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6364
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-title"], ["id", 100], ["LIMIT", 1]]
|
6365
|
+
[1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-title"], ["updated_at", 2016-12-31 06:03:41 UTC], ["id", 100]]
|
6366
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6367
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6368
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6369
|
+
------------------------------------------------
|
6370
|
+
SluggableTest: test_validates_uniqueness_of_slug
|
6371
|
+
------------------------------------------------
|
6372
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6373
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6374
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slug"], ["created_at", 2016-12-31 06:03:41 UTC], ["updated_at", 2016-12-31 06:03:41 UTC]]
|
6375
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6376
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6377
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6378
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6379
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6380
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6381
|
+
-----------------------------------------------------------------------------------
|
6382
|
+
SluggableTest: test_slug_does_not_update_an_existing_slug_when_source_field_changes
|
6383
|
+
-----------------------------------------------------------------------------------
|
6384
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6385
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6386
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 06:03:41 UTC], ["updated_at", 2016-12-31 06:03:41 UTC]]
|
6387
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6388
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6389
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.4ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-old-slug"], ["id", 101], ["LIMIT", 1]]
|
6390
|
+
[1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "title" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["title", "Changed Title"], ["updated_at", 2016-12-31 06:03:41 UTC], ["id", 101]]
|
6391
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6392
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
6393
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6394
|
+
--------------------------------------------------------------------
|
6395
|
+
SluggableTest: test_.sluggify_can_generate_slug_from_given_attribute
|
6396
|
+
--------------------------------------------------------------------
|
6397
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6398
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-title"], ["LIMIT", 1]]
|
6399
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "My Title"], ["slug", "my-title"], ["created_at", 2016-12-31 06:03:41 UTC], ["updated_at", 2016-12-31 06:03:41 UTC]]
|
6400
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6401
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6402
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6403
|
+
----------------------------------------------
|
6404
|
+
SluggableTest: test_validates_presence_of_slug
|
6405
|
+
----------------------------------------------
|
6406
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6407
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", ""], ["LIMIT", 1]]
|
6408
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6409
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6410
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6411
|
+
----------------------------------------------
|
6412
|
+
SluggableTest: test_#to_param_returns_the_slug
|
6413
|
+
----------------------------------------------
|
6414
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6415
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "slug"], ["LIMIT", 1]]
|
6416
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "slug"], ["created_at", 2016-12-31 06:03:41 UTC], ["updated_at", 2016-12-31 06:03:41 UTC]]
|
6417
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6418
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6419
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.9ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
6420
|
+
[1m[35m (0.4ms)[0m [1m[35mBEGIN[0m
|
6421
|
+
--------------------------------------------------------
|
6422
|
+
SluggableTest: test_validates_case_insensitivity_of_slug
|
6423
|
+
--------------------------------------------------------
|
6424
|
+
[1m[35m (0.5ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6425
|
+
[1m[36mTaggable Exists (1.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slugi"], ["LIMIT", 1]]
|
6426
|
+
[1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slugi"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6427
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6428
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6429
|
+
[1m[36mTaggable Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6430
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slug"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6431
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6432
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
6433
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
6434
|
+
-----------------------------------------------------------------------------------
|
6435
|
+
SluggableTest: test_slug_does_not_update_an_existing_slug_when_source_field_changes
|
6436
|
+
-----------------------------------------------------------------------------------
|
6437
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6438
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6439
|
+
[1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6440
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6441
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6442
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-old-slug"], ["id", 103], ["LIMIT", 1]]
|
6443
|
+
[1m[35mSQL (0.7ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "title" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["title", "Changed Title"], ["updated_at", 2016-12-31 06:04:01 UTC], ["id", 103]]
|
6444
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6445
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6446
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6447
|
+
------------------------------------------------------------------------
|
6448
|
+
SluggableTest: test_slug_properly_formats_string_to_slug_friendly_format
|
6449
|
+
------------------------------------------------------------------------
|
6450
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6451
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "this-i-my-slug"], ["LIMIT", 1]]
|
6452
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "this-i-my-slug"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6453
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6454
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6455
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6456
|
+
----------------------------------------------
|
6457
|
+
SluggableTest: test_#to_param_returns_the_slug
|
6458
|
+
----------------------------------------------
|
6459
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6460
|
+
[1m[36mTaggable Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "slug"], ["LIMIT", 1]]
|
6461
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "slug"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6462
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6463
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6464
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6465
|
+
--------------------------------------------------------------------
|
6466
|
+
SluggableTest: test_.sluggify_can_generate_slug_from_given_attribute
|
6467
|
+
--------------------------------------------------------------------
|
6468
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6469
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-title"], ["LIMIT", 1]]
|
6470
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "My Title"], ["slug", "my-title"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6471
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6472
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6473
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6474
|
+
------------------------------------------------------------------------------
|
6475
|
+
SluggableTest: test_slug_properly_updates_an_existing_slug_when_auto_generated
|
6476
|
+
------------------------------------------------------------------------------
|
6477
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6478
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6479
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6480
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6481
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6482
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-new-slug"], ["id", 105], ["LIMIT", 1]]
|
6483
|
+
[1m[35mSQL (1.4ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-new-slug"], ["updated_at", 2016-12-31 06:04:01 UTC], ["id", 105]]
|
6484
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6485
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6486
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE "taggable_w_generated_slugs"."slug" = $1 AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-title"], ["id", 105], ["LIMIT", 1]]
|
6487
|
+
[1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-title"], ["updated_at", 2016-12-31 06:04:01 UTC], ["id", 105]]
|
6488
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6489
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6490
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6491
|
+
------------------------------------------------
|
6492
|
+
SluggableTest: test_validates_uniqueness_of_slug
|
6493
|
+
------------------------------------------------
|
6494
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6495
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6496
|
+
[1m[35mSQL (0.8ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slug"], ["created_at", 2016-12-31 06:04:01 UTC], ["updated_at", 2016-12-31 06:04:01 UTC]]
|
6497
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6498
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6499
|
+
[1m[36mTaggable Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6500
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6501
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6502
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6503
|
+
----------------------------------------------
|
6504
|
+
SluggableTest: test_validates_presence_of_slug
|
6505
|
+
----------------------------------------------
|
6506
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6507
|
+
[1m[36mTaggable Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE "taggables"."slug" = $1 LIMIT $2[0m [["slug", ""], ["LIMIT", 1]]
|
6508
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6509
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6510
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6511
|
+
-------------------------
|
6512
|
+
HumanUrlsTest: test_truth
|
6513
|
+
-------------------------
|
6514
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6515
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6516
|
+
------------------------------------------------------------------------------
|
6517
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration
|
6518
|
+
------------------------------------------------------------------------------
|
6519
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6520
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6521
|
+
------------------------------------------------------------------------------------------------------------
|
6522
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration_when_using_custom_slug_column
|
6523
|
+
------------------------------------------------------------------------------------------------------------
|
6524
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
6525
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.2ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
6526
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6527
|
+
------------------------------------------------------------------------------
|
6528
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration
|
6529
|
+
------------------------------------------------------------------------------
|
6530
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6531
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6532
|
+
------------------------------------------------------------------------------------------------------------
|
6533
|
+
HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration_when_using_custom_slug_column
|
6534
|
+
------------------------------------------------------------------------------------------------------------
|
6535
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
6536
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6537
|
+
----------------------------------------------
|
6538
|
+
SluggableTest: test_#to_param_returns_the_slug
|
6539
|
+
----------------------------------------------
|
6540
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6541
|
+
[1m[36mTaggable Exists (2.2ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE LOWER("taggables"."slug") = LOWER($1) LIMIT $2[0m [["slug", "slug"], ["LIMIT", 1]]
|
6542
|
+
[1m[35mSQL (2.8ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "slug"], ["created_at", 2016-12-31 06:08:14 UTC], ["updated_at", 2016-12-31 06:08:14 UTC]]
|
6543
|
+
[1m[35m (0.4ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6544
|
+
[1m[35m (0.6ms)[0m [1m[31mROLLBACK[0m
|
6545
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6546
|
+
--------------------------------------------------------------------
|
6547
|
+
SluggableTest: test_.sluggify_can_generate_slug_from_given_attribute
|
6548
|
+
--------------------------------------------------------------------
|
6549
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6550
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.9ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE LOWER("taggable_w_generated_slugs"."slug") = LOWER($1) LIMIT $2[0m [["slug", "my-title"], ["LIMIT", 1]]
|
6551
|
+
[1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "My Title"], ["slug", "my-title"], ["created_at", 2016-12-31 06:08:14 UTC], ["updated_at", 2016-12-31 06:08:14 UTC]]
|
6552
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6553
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6554
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6555
|
+
------------------------------------------------
|
6556
|
+
SluggableTest: test_validates_uniqueness_of_slug
|
6557
|
+
------------------------------------------------
|
6558
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6559
|
+
[1m[36mTaggable Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE LOWER("taggables"."slug") = LOWER($1) LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6560
|
+
[1m[35mSQL (0.7ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slug"], ["created_at", 2016-12-31 06:08:14 UTC], ["updated_at", 2016-12-31 06:08:14 UTC]]
|
6561
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6562
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6563
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE LOWER("taggables"."slug") = LOWER($1) LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6564
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6565
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6566
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6567
|
+
------------------------------------------------------------------------------
|
6568
|
+
SluggableTest: test_slug_properly_updates_an_existing_slug_when_auto_generated
|
6569
|
+
------------------------------------------------------------------------------
|
6570
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6571
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE LOWER("taggable_w_generated_slugs"."slug") = LOWER($1) LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6572
|
+
[1m[35mSQL (0.9ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 06:08:14 UTC], ["updated_at", 2016-12-31 06:08:14 UTC]]
|
6573
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6574
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6575
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.8ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE LOWER("taggable_w_generated_slugs"."slug") = LOWER($1) AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-new-slug"], ["id", 107], ["LIMIT", 1]]
|
6576
|
+
[1m[35mSQL (0.8ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-new-slug"], ["updated_at", 2016-12-31 06:08:14 UTC], ["id", 107]]
|
6577
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6578
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6579
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.7ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE LOWER("taggable_w_generated_slugs"."slug") = LOWER($1) AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-title"], ["id", 107], ["LIMIT", 1]]
|
6580
|
+
[1m[35mSQL (0.6ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["slug", "my-title"], ["updated_at", 2016-12-31 06:08:14 UTC], ["id", 107]]
|
6581
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6582
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6583
|
+
[1m[35m (0.4ms)[0m [1m[35mBEGIN[0m
|
6584
|
+
------------------------------------------------------------------------
|
6585
|
+
SluggableTest: test_slug_properly_formats_string_to_slug_friendly_format
|
6586
|
+
------------------------------------------------------------------------
|
6587
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6588
|
+
[1m[36mTaggable Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE LOWER("taggables"."slug") = LOWER($1) LIMIT $2[0m [["slug", "this-i-my-slug"], ["LIMIT", 1]]
|
6589
|
+
[1m[35mSQL (0.6ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "this-i-my-slug"], ["created_at", 2016-12-31 06:08:14 UTC], ["updated_at", 2016-12-31 06:08:14 UTC]]
|
6590
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6591
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6592
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6593
|
+
-----------------------------------------------------------------------------------
|
6594
|
+
SluggableTest: test_slug_does_not_update_an_existing_slug_when_source_field_changes
|
6595
|
+
-----------------------------------------------------------------------------------
|
6596
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6597
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE LOWER("taggable_w_generated_slugs"."slug") = LOWER($1) LIMIT $2[0m [["slug", "my-old-slug"], ["LIMIT", 1]]
|
6598
|
+
[1m[35mSQL (0.5ms)[0m [1m[32mINSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", 2016-12-31 06:08:14 UTC], ["updated_at", 2016-12-31 06:08:14 UTC]]
|
6599
|
+
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6600
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6601
|
+
[1m[36mTaggableWGeneratedSlug Exists (0.6ms)[0m [1m[34mSELECT 1 AS one FROM "taggable_w_generated_slugs" WHERE LOWER("taggable_w_generated_slugs"."slug") = LOWER($1) AND ("taggable_w_generated_slugs"."id" != $2) LIMIT $3[0m [["slug", "my-old-slug"], ["id", 108], ["LIMIT", 1]]
|
6602
|
+
[1m[35mSQL (0.4ms)[0m [1m[33mUPDATE "taggable_w_generated_slugs" SET "title" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3[0m [["title", "Changed Title"], ["updated_at", 2016-12-31 06:08:14 UTC], ["id", 108]]
|
6603
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6604
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
6605
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6606
|
+
--------------------------------------------------------
|
6607
|
+
SluggableTest: test_validates_case_insensitivity_of_slug
|
6608
|
+
--------------------------------------------------------
|
6609
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6610
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE LOWER("taggables"."slug") = LOWER($1) LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6611
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["slug", "test-slug"], ["created_at", 2016-12-31 06:08:14 UTC], ["updated_at", 2016-12-31 06:08:14 UTC]]
|
6612
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
6613
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6614
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE LOWER("taggables"."slug") = LOWER($1) LIMIT $2[0m [["slug", "test-slug"], ["LIMIT", 1]]
|
6615
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6616
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6617
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
6618
|
+
----------------------------------------------
|
6619
|
+
SluggableTest: test_validates_presence_of_slug
|
6620
|
+
----------------------------------------------
|
6621
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
6622
|
+
[1m[36mTaggable Exists (0.5ms)[0m [1m[34mSELECT 1 AS one FROM "taggables" WHERE LOWER("taggables"."slug") = LOWER($1) LIMIT $2[0m [["slug", ""], ["LIMIT", 1]]
|
6623
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
6624
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
6625
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
6626
|
+
-------------------------
|
6627
|
+
HumanUrlsTest: test_truth
|
6219
6628
|
-------------------------
|
6220
6629
|
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
File without changes
|
@@ -26,6 +26,12 @@ class SluggableTest < ActiveSupport::TestCase
|
|
26
26
|
assert_match(/Validation failed: Slug has already been taken/, exp.message)
|
27
27
|
end
|
28
28
|
|
29
|
+
test "validates case insensitivity of slug" do
|
30
|
+
Taggable.create!(slug: 'test-SLUG')
|
31
|
+
exp = assert_raises { Taggable.create!(slug: 'test-slug') }
|
32
|
+
assert_match(/Validation failed: Slug has already been taken/, exp.message)
|
33
|
+
end
|
34
|
+
|
29
35
|
test "slug properly formats string to slug friendly format" do
|
30
36
|
taggable = Taggable.create!(slug: "This i$ my SLUG")
|
31
37
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: human_urls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6.pre.alpha.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Klina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -109,7 +109,7 @@ files:
|
|
109
109
|
- test/dummy/public/422.html
|
110
110
|
- test/dummy/public/500.html
|
111
111
|
- test/dummy/public/favicon.ico
|
112
|
-
- test/dummy/tmp/generators/db/migrate/
|
112
|
+
- test/dummy/tmp/generators/db/migrate/20161231060814_add_slug_to_posts.rb
|
113
113
|
- test/human_urls/sluggable_test.rb
|
114
114
|
- test/human_urls_test.rb
|
115
115
|
- test/lib/generators/human_urls/slug_migration_generator_test.rb
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
version: 1.3.1
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.5.1
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: A simple way to add slugs to your Rails application
|
@@ -177,7 +177,7 @@ test_files:
|
|
177
177
|
- test/dummy/public/500.html
|
178
178
|
- test/dummy/public/favicon.ico
|
179
179
|
- test/dummy/Rakefile
|
180
|
-
- test/dummy/tmp/generators/db/migrate/
|
180
|
+
- test/dummy/tmp/generators/db/migrate/20161231060814_add_slug_to_posts.rb
|
181
181
|
- test/human_urls/sluggable_test.rb
|
182
182
|
- test/human_urls_test.rb
|
183
183
|
- test/lib/generators/human_urls/slug_migration_generator_test.rb
|