mirror of
https://github.com/redmine/redmine.git
synced 2025-11-01 10:56:17 +01:00
Adds flash messages to files_controller#create (#19793).
git-svn-id: http://svn.redmine.org/redmine/trunk@14243 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -106,4 +106,15 @@ class FilesControllerTest < ActionController::TestCase
|
||||
assert_equal Version.find(2), a.container
|
||||
end
|
||||
|
||||
def test_create_without_file
|
||||
set_tmp_attachments_directory
|
||||
@request.session[:user_id] = 2
|
||||
|
||||
assert_no_difference 'Attachment.count' do
|
||||
post :create, :project_id => 1, :version_id => ''
|
||||
assert_response 200
|
||||
assert_template 'new'
|
||||
end
|
||||
assert_select 'div.error', 'File is invalid'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user