Sha256: 3bf057a05d85980f934247b88157fe510f6d46e7d3e95bda6951be2c1329983c
Contents?: true
Size: 1.43 KB
Versions: 13
Compression:
Stored size: 1.43 KB
Contents
require File.dirname(__FILE__) + '/../../test/test_helper' class I18nMessagesTest < Test::Unit::TestCase def test_should_have_default_message p = PhotoBare.new p.save assert_equal "is required", p.errors["image_file"] p = PhotoBare.new(:image_file => files(:not_a_photo)) p.save assert_equal "was not a readable image", p.errors["image_file"] p = PhotoBare.new(:image_file => files(:i1x1)) p.save assert_equal "is too small (Minimum: 2x2)", p.errors["image_file"] end def test_should_have_german_message I18n.locale = "de" p = PhotoBare.new p.save assert_equal "ist erforderlich", p.errors["image_file"] p = PhotoBare.new(:image_file => files(:not_a_photo)) p.save assert_equal "war nicht lesbar", p.errors["image_file"] p = PhotoBare.new(:image_file => files(:i1x1)) p.save assert_equal "ist zu klein (Minimalgröße: 2x2)", p.errors["image_file"] ensure I18n.locale = "en" end def test_should_have_model_specific_message p = PhotoCustomError.new assert !p.save assert_equal "needs to be attached", p.errors["image_file"] p = PhotoCustomError.new(:image_file => files(:not_a_photo)) p.save assert_equal "seems to be broken", p.errors["image_file"] p = PhotoCustomError.new(:image_file => files(:i1x1)) assert !p.save assert_equal "must be bigger (min. size: 2x2)", p.errors["image_file"] end end
Version data entries
13 entries across 13 versions & 4 rubygems