rails_slugs 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  class RailsSlugsTest < ActiveSupport::TestCase
4
4
 
5
- test 'truth' do
5
+ test "truth" do
6
6
  assert_kind_of Module, RailsSlugs
7
7
  end
8
8
 
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 'should not break without models' do
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 'shoud create slug' do
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 'should edit slug' do
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 'should not alter direct assigned slug' do
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 'should assign index for same slugs' do
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.7
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-05 00:00:00.000000000 Z
12
+ date: 2013-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails