test/validator_test.rb in polish_invoicer-0.0.25 vs test/validator_test.rb in polish_invoicer-0.0.26
- old
+ new
@@ -176,9 +176,23 @@
v = Validator.new(@invoice)
v.valid?
refute v.errors[:exchange_rate]
end
+ def test_lang
+ v = Validator.new(@invoice)
+ v.valid?
+ refute v.errors[:lang]
+ @invoice.lang = 'xx'
+ v = Validator.new(@invoice)
+ v.valid?
+ assert v.errors[:lang]
+ @invoice.lang = 'en'
+ v = Validator.new(@invoice)
+ v.valid?
+ refute v.errors[:lang]
+ end
+
private
def check_error(field, value = nil)
@invoice.send("#{field}=", value)
v = Validator.new(@invoice)