test/validators_test.rb in rails_uploads-0.1.4 vs test/validators_test.rb in rails_uploads-0.1.5
- old
+ new
@@ -3,22 +3,22 @@
class ValidatorsTest < ActiveSupport::TestCase
include ActionDispatch::TestProcess
setup :create_record
- test 'should check if file is present' do
+ test "should check if file is present" do
assert !@record.valid?
assert_equal [I18n.t('errors.messages.attachment_presence')], @record.errors[:file_presence]
@record.image_presence = fixture_file_upload(::File.join('', 'image.jpg'), 'image/jpeg')
assert !@record.valid?
assert_equal [], @record.errors[:image_presence]
end
- test 'should check the file content type' do
+ test "should check the file content type" do
@record.image_content_type = fixture_file_upload(::File.join('', 'file.txt'), 'text/plain')
assert !@record.valid?
assert_equal [I18n.t('errors.messages.attachment_content_type', :types => 'jpg')], @record.errors[:image_content_type]
@@ -26,11 +26,11 @@
assert !@record.valid?
assert_equal [I18n.t('errors.messages.attachment_content_type', :types => 'txt')], @record.errors[:file_content_type]
end
- test 'should check the file size' do
+ test "should check the file size" do
@record.file_size = fixture_file_upload(::File.join('', 'file_big.txt'), 'text/plain')
assert !@record.valid?
assert_equal [I18n.t('errors.messages.attachment_size_less_than', :less_than => 15.kilobytes)], @record.errors[:file_size]
@@ -54,10 +54,10 @@
assert !@record.valid?
assert_equal [], @record.errors[:image_size]
end
- test 'should check all the validations together' do
+ test "should check all the validations together" do
@record.file_all = fixture_file_upload(::File.join('', 'file.txt'), 'text/plain')
assert !@record.valid?
assert_equal [], @record.errors[:file_all]