spec/mapper_spec.rb in errawr-1.1.4 vs spec/mapper_spec.rb in errawr-1.1.5
- old
+ new
@@ -34,7 +34,25 @@
Errawr.error!(:dummy_error)
rescue => e
e.metadata.include?(:error).should be_false
end
end
+
+ it 'should return an overridden message for a non-hashed locale' do
+ Errawr.register!(:some_error, message: 'Overridden error message')
+ begin
+ Errawr.error!(:some_error)
+ rescue => e
+ e.message.should == 'Overridden error message'
+ end
+ end
+
+ it 'should return an overridden message for a hashed locale' do
+ Errawr.register!(:error_hash, message: 'Overridden error message')
+ begin
+ Errawr.error!(:error_hash)
+ rescue => e
+ e.message.should == 'Overridden error message'
+ end
+ end
end
end
\ No newline at end of file