human_urls 0.1.0 → 0.1.1
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 +6 -1
- data/lib/human_urls/version.rb +1 -1
- data/test/dummy/log/test.log +1655 -0
- data/test/dummy/tmp/generators/db/migrate/20151114224559_add_slug_to_posts.rb +6 -0
- data/test/human_urls/sluggable_test.rb +12 -0
- metadata +4 -4
- data/test/dummy/tmp/generators/db/migrate/20151112020841_add_slug_to_posts.rb +0 -6
@@ -38,6 +38,18 @@ class SluggableTest < ActiveSupport::TestCase
|
|
38
38
|
assert_match("this-i-my-slug", taggable.slug)
|
39
39
|
end
|
40
40
|
|
41
|
+
test "slug properly updates an existing slug when auto generated" do
|
42
|
+
taggable = TaggableWGeneratedSlug.
|
43
|
+
create!(title: "my-title", slug: "my-old-slug")
|
44
|
+
taggable.update!(slug: "my-new-slug")
|
45
|
+
|
46
|
+
assert_match("my-new-slug", taggable.slug)
|
47
|
+
|
48
|
+
taggable.update!(slug: "")
|
49
|
+
|
50
|
+
assert_match("my-title", taggable.slug)
|
51
|
+
end
|
52
|
+
|
41
53
|
test "#to_param returns the slug" do
|
42
54
|
taggable = Taggable.create!(slug: "slug")
|
43
55
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Klina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -122,7 +122,7 @@ files:
|
|
122
122
|
- test/dummy/public/422.html
|
123
123
|
- test/dummy/public/500.html
|
124
124
|
- test/dummy/public/favicon.ico
|
125
|
-
- test/dummy/tmp/generators/db/migrate/
|
125
|
+
- test/dummy/tmp/generators/db/migrate/20151114224559_add_slug_to_posts.rb
|
126
126
|
- test/human_urls/sluggable_test.rb
|
127
127
|
- test/human_urls_test.rb
|
128
128
|
- test/lib/generators/human_urls/slug_migration_generator_test.rb
|
@@ -189,7 +189,7 @@ test_files:
|
|
189
189
|
- test/dummy/public/favicon.ico
|
190
190
|
- test/dummy/Rakefile
|
191
191
|
- test/dummy/README.rdoc
|
192
|
-
- test/dummy/tmp/generators/db/migrate/
|
192
|
+
- test/dummy/tmp/generators/db/migrate/20151114224559_add_slug_to_posts.rb
|
193
193
|
- test/human_urls/sluggable_test.rb
|
194
194
|
- test/human_urls_test.rb
|
195
195
|
- test/lib/generators/human_urls/slug_migration_generator_test.rb
|