Skip to content

Instantly share code, notes, and snippets.

@mattfitzgerald
Created February 22, 2012 04:27
Show Gist options
  • Save mattfitzgerald/1881361 to your computer and use it in GitHub Desktop.
Save mattfitzgerald/1881361 to your computer and use it in GitHub Desktop.
# in the console I see this
>> d.modify_value("123")
FieldType::CriterionConversionError: Unable to parse "123" as a date, giving up
from ./lib/field_types/date.rb:104:in `modify_value'
from (irb):4
# in the spec this
it "should not parse single integers" do
@date_field.modify_value('1').should raise_error FieldType::CriterionConversionError
end
# produces this
should not parse single integers (FAILED - 1)
1)
FieldType::CriterionConversionError in 'FieldType::Date should not parse single integers'
Unable to parse "1" as a date, giving up
./spec/models/date_field_type_spec.rb:40:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment