rails_slugs 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rails_slugs/active_record/base.rb +19 -16
- data/lib/rails_slugs/version.rb +1 -1
- data/test/dummy/log/test.log +1379 -0
- data/test/rails_slugs_test.rb +1 -1
- data/test/records_test.rb +11 -5
- metadata +2 -2
data/test/rails_slugs_test.rb
CHANGED
data/test/records_test.rb
CHANGED
@@ -4,20 +4,26 @@ class RecordsTest < ActiveSupport::TestCase
|
|
4
4
|
|
5
5
|
setup :create_records
|
6
6
|
|
7
|
-
test
|
7
|
+
test "should not break validation" do
|
8
|
+
assert Without.new.valid?
|
9
|
+
assert Simple.new.valid?
|
10
|
+
assert Translatable.new.valid?
|
11
|
+
end
|
12
|
+
|
13
|
+
test "should not break without models" do
|
8
14
|
assert_equal 'name', @without.name
|
9
15
|
assert_equal @without, Without.find('1')
|
10
16
|
assert_equal @without, Without.find(1)
|
11
17
|
end
|
12
18
|
|
13
|
-
test
|
19
|
+
test "shoud create slug" do
|
14
20
|
assert_equal 'name', @simple.slug
|
15
21
|
assert_equal @simple, Simple.find('name')
|
16
22
|
assert_equal 'translatable-name', @translatable.slug
|
17
23
|
assert_equal @translatable, Translatable.find('translatable-name')
|
18
24
|
end
|
19
25
|
|
20
|
-
test
|
26
|
+
test "should edit slug" do
|
21
27
|
@simple.update_attributes :name => 'new name'
|
22
28
|
assert_equal 'new-name', @simple.slug
|
23
29
|
assert_equal @simple, Simple.find('new-name')
|
@@ -26,7 +32,7 @@ class RecordsTest < ActiveSupport::TestCase
|
|
26
32
|
assert_equal @translatable, Translatable.find('new-translatable-name')
|
27
33
|
end
|
28
34
|
|
29
|
-
test
|
35
|
+
test "should not alter direct assigned slug" do
|
30
36
|
@simple.update_attributes :slug => 'direct slug'
|
31
37
|
assert_equal 'direct slug', @simple.slug
|
32
38
|
assert_equal @simple, Simple.find('direct slug')
|
@@ -35,7 +41,7 @@ class RecordsTest < ActiveSupport::TestCase
|
|
35
41
|
assert_equal @translatable, Translatable.find('translatable direct slug')
|
36
42
|
end
|
37
43
|
|
38
|
-
test
|
44
|
+
test "should assign index for same slugs" do
|
39
45
|
first = Simple.create(:name => 'same', :age => 34)
|
40
46
|
assert_equal 'same', first.slug
|
41
47
|
second = Simple.create(:name => 'same', :age => 45)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_slugs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|