mleung-koujou 0.0.6 → 0.0.7
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/README.rdoc +1 -1
- data/lib/koujou.rb +1 -1
- data/lib/koujou/builder.rb +1 -1
- data/lib/koujou/data_generator.rb +1 -1
- data/test/test_builder.rb +5 -0
- data/test/test_data_generator.rb +2 -3
- metadata +1 -1
data/README.rdoc
CHANGED
data/lib/koujou.rb
CHANGED
data/lib/koujou/builder.rb
CHANGED
@@ -43,9 +43,9 @@ module Koujou #:nodoc:
|
|
43
43
|
|
44
44
|
set_required_attributes!(instance, attributes)
|
45
45
|
set_unique_attributes!(instance, attributes)
|
46
|
-
set_confirmation_attributes!(instance, attributes)
|
47
46
|
set_length_validated_attributes!(instance, attributes)
|
48
47
|
set_inclusion_validated_attributes!(instance, attributes)
|
48
|
+
set_confirmation_attributes!(instance, attributes)
|
49
49
|
create_associations(instance, recursed_from_model)
|
50
50
|
CustomValidation.stub_custom_validations!(instance)
|
51
51
|
|
data/test/test_builder.rb
CHANGED
@@ -41,6 +41,11 @@ class TestBuilder < Test::Unit::TestCase
|
|
41
41
|
assert_not_nil u.password_confirmation
|
42
42
|
end
|
43
43
|
|
44
|
+
should 'have the same value for password_confirmation as password' do
|
45
|
+
u = User.koujou
|
46
|
+
assert_equal u.password, u.password_confirmation
|
47
|
+
end
|
48
|
+
|
44
49
|
should 'allow me to override the model attributes' do
|
45
50
|
namae = 'One Factory to Rule them all'
|
46
51
|
p = Post.koujou(true, :name => namae)
|
data/test/test_data_generator.rb
CHANGED
@@ -23,7 +23,7 @@ class TestDataGenerator < Test::Unit::TestCase
|
|
23
23
|
end
|
24
24
|
|
25
25
|
should 'generate a valid string' do
|
26
|
-
@validation.expects(:name).
|
26
|
+
@validation.expects(:name).at_least_once.returns('name')
|
27
27
|
string = Koujou::DataGenerator.new(false, @validation).generate_data_for_column_type
|
28
28
|
assert_kind_of String, string
|
29
29
|
assert string.size > 0
|
@@ -51,7 +51,6 @@ class TestDataGenerator < Test::Unit::TestCase
|
|
51
51
|
@validation.expects(:name).twice.returns('terms_of_service')
|
52
52
|
assert Koujou::DataGenerator.new(false, @validation).generate_data_for_column_type
|
53
53
|
end
|
54
|
-
|
55
54
|
end
|
56
55
|
|
57
56
|
context 'on generate with a required length' do
|
@@ -92,4 +91,4 @@ class TestDataGenerator < Test::Unit::TestCase
|
|
92
91
|
|
93
92
|
end
|
94
93
|
|
95
|
-
end
|
94
|
+
end
|