summaryrefslogtreecommitdiffstats
path: root/test/functional/files_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-09 10:29:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-09 10:29:21 +0000
commitfd034f734183a650aa40eacc0285d6737a26190c (patch)
tree4b3c697bc5660f303c5f56a124853b34390e7ce7 /test/functional/files_controller_test.rb
parent27bcd879f31450bf32397864b4d36d2bacc8ee6d (diff)
downloadredmine-fd034f734183a650aa40eacc0285d6737a26190c.tar.gz
redmine-fd034f734183a650aa40eacc0285d6737a26190c.zip
Adds flash messages to files_controller#create (#19793).
git-svn-id: http://svn.redmine.org/redmine/trunk@14243 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/files_controller_test.rb')
-rw-r--r--test/functional/files_controller_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/files_controller_test.rb b/test/functional/files_controller_test.rb
index b4d7d7d27..d79b88a47 100644
--- a/test/functional/files_controller_test.rb
+++ b/test/functional/files_controller_test.rb
@@ -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