search for: validate_format_of

Displaying 4 results from an estimated 4 matches for "validate_format_of".

Did you mean: validates_format_of
2012 Aug 09
2
validate_format_of message
I have validates_format_of :name, :with => *my regex*, :message => "That''s wrong" The validation works but the message does not get displayed when the user enters invalid data. Does anyone have any ideas how to fix it? Thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2012 Jan 19
0
Problem in testing with separate validation of :attachment_file_name
...s_attached_file :attachment validates_attachment_presence :attachment validates_format_of :attachment_file_name, :with => /\.(png|jpe?g)$/ end Example Test require ''spec/helper'' describe Example do it { should validate_attachment_presence(:attachment) } it { should validate_format_of(:attachment_file_name). with(''example.png'') } it { should validate_format_of(:attachment_file_name). not_with(''example.zip''). with_message(/is invalid/) } end This causes my validates_attachment_presence(:attachment) test to fail...
2007 May 05
10
have_one and have_present
>Comment By: Luis Lavena (luislavena) > Date: 2007-05-04 23:37 > describe "An Asset" do > before(:each) do > @asset = Asset.new > end > > it { @asset.should have_one(:attachment) } > it { @asset.should have_present(:something) } > end Food for thought on these. I like have_one a lot. It speaks to me as a Rails developer and I think it speaks to
2007 Mar 29
21
a better "should have valid associations"
This is pretty much the same as last time around, if you recall. Thanks to Wilson for converting to the new form. I''ve added a few lines. Basically, it iterates over your model associations and does two things. - First, just try to call the association. Usually fixes speeling erors or other such silliness. - Second, try to find a record with an :include on the association. This