Permalink
Browse files

Updated tests in preparation for Paperclip 4.0

  • Loading branch information...
1 parent 44f61e6 commit c381fea139471d905e925af5b0214261fd83d2e0 @mischa78 committed Feb 6, 2014
Showing with 9 additions and 9 deletions.
  1. +3 −3 test/unit/clipboard_test.rb
  2. +6 −6 test/unit/user_file_test.rb
@@ -89,10 +89,10 @@ class ClipboardTest < ActiveSupport::TestCase
file = create(:user_file)
clipboard = Clipboard.new
clipboard.add(file)
- assert_not_equal clipboard.files.first.attachment_file_name, 'Name changed'
+ assert_not_equal clipboard.files.first.attachment_file_name, 'Name changed.txt'
- file.update_attributes(:attachment_file_name => 'Name changed')
- assert_equal clipboard.files.first.attachment_file_name, 'Name changed'
+ file.update_attributes(:attachment_file_name => 'Name changed.txt')
+ assert_equal clipboard.files.first.attachment_file_name, 'Name changed.txt'
end
test 'a deleted folder must also be deleted from the clipboard' do
@@ -42,28 +42,28 @@ class UserFileTest < ActiveSupport::TestCase
test 'attachment file name is unique' do
file = create(:user_file)
- file.update_attributes(:attachment_file_name => 'Test')
- assert UserFile.exists?(:attachment_file_name => 'Test')
+ file.update_attributes(:attachment_file_name => 'Test.txt')
+ assert UserFile.exists?(:attachment_file_name => 'Test.txt')
folder = create(:folder)
file2 = folder.user_files.build(:attachment => fixture_file)
- file2.attachment_file_name = 'Test'
+ file2.attachment_file_name = 'Test.txt'
assert file2.save
file3 = Folder.root.user_files.build(:attachment => fixture_file)
- file3.attachment_file_name = 'Test'
+ file3.attachment_file_name = 'Test.txt'
assert !file3.save
end
test 'attachment file name cannot contain invalid characters' do
file = create(:user_file)
%w{< > : " / \ | ? *}.each do |invalid_character|
- file.attachment_file_name = "Test#{invalid_character}"
+ file.attachment_file_name = "Test#{invalid_character}.txt"
assert !file.save
end
- file.attachment_file_name = 'Test'
+ file.attachment_file_name = 'Test.txt'
assert file.save
end

0 comments on commit c381fea

Please sign in to comment.