https://svn.lrde.epita.fr/svn/ranch/trunk
Index: ChangeLog
from Nicolas Despr�s <nicolas.despres(a)gmail.com>
Update inputs test unit.
* web/ranch/test/unit/input_test.rb: Assert fixtures are correct and
ensure other tests stress only the expected validation rule.
input_test.rb | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
Index: web/ranch/test/unit/input_test.rb
--- web/ranch/test/unit/input_test.rb (revision 52)
+++ web/ranch/test/unit/input_test.rb (working copy)
@@ -7,14 +7,24 @@
assert Input.new.save
end
+ def test_save_fixtures
+ Input.find_all.each do |input|
+ assert(input.save,
+ "cannot save #{input.name}: " +
+ input.errors.full_messages.inspect)
+ end
+ end
+
def test_save_arg_num_is_positive
- output = Output.new(:arg_num => -1)
- assert !output.save
+ input = inputs("determinize_r1_foo_1")
+ input.arg_num = -1
+ assert !input.save
end
def test_save_set_num_is_positive_or_zero
- output = Output.new(:set_num => -1)
- assert !output.save
+ input = inputs("determinize_r1_foo_1")
+ input.set_num = -1
+ assert !input.save
end
end