Skip to content
Browse files

Fix failing AR spec for validation

  • Loading branch information...
1 parent cf34998 commit 3183a24b1ad5427ff1032865b0b45447a80d3a33 @jnicklas jnicklas committed Jul 20, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 spec/orm/activerecord_spec.rb
View
10 spec/orm/activerecord_spec.rb
@@ -94,7 +94,7 @@ class Event#{$arclass} < Event; end
it "should copy a file into into the cache directory" do
@event.image = stub_file('test.jpeg')
- @event.image.current_path.should =~ /^#{public_path('uploads/tmp')}/
+ @event.image.current_path.should =~ %r(^#{public_path('uploads/tmp')})
end
it "should do nothing when nil is assigned" do
@@ -123,13 +123,13 @@ def extension_white_list
it "should use I18n for integrity error messages" do
@event.valid?
- @event.errors[:image].to_s.should == 'is not an allowed type of file.'
+ @event.errors[:image].should == ['is not an allowed type of file.']
change_locale_and_store_translations(:pt, :carrierwave => {
:errors => { :integrity => 'tipo de imagem não permitido.' }
}) do
@event.should_not be_valid
- @event.errors[:image].to_s.should == 'tipo de imagem não permitido.'
+ @event.errors[:image].should == ['tipo de imagem não permitido.']
end
end
end
@@ -151,13 +151,13 @@ def monkey
it "should use I18n for processing error messages" do
@event.valid?
- @event.errors[:image].to_s.should == 'failed to be processed.'
+ @event.errors[:image].should == ['failed to be processed.']
change_locale_and_store_translations(:pt, :carrierwave => {
:errors => { :processing => 'falha ao processar imagem.' }
}) do
@event.should_not be_valid
- @event.errors[:image].to_s.should == 'falha ao processar imagem.'
+ @event.errors[:image].should == ['falha ao processar imagem.']
end
end
end

0 comments on commit 3183a24

Please sign in to comment.
Something went wrong with that request. Please try again.