summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-23 15:41:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-23 15:41:29 +0000
commit71c83e115507d0451178ee4159defc4a4afc7365 (patch)
tree437891248075d4c3fb79bdfef586742f0bec8d00 /test
parent8cfc0804703716980e94b986646b85326bc763c6 (diff)
downloadredmine-71c83e115507d0451178ee4159defc4a4afc7365.tar.gz
redmine-71c83e115507d0451178ee4159defc4a4afc7365.zip
Adds functional tests.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8954 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/files_controller_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/files_controller_test.rb b/test/functional/files_controller_test.rb
index ce61a85f1..3cd0bfc01 100644
--- a/test/functional/files_controller_test.rb
+++ b/test/functional/files_controller_test.rb
@@ -36,6 +36,25 @@ class FilesControllerTest < ActionController::TestCase
:attributes => { :href => '/attachments/download/9/version_file.zip' }
end
+ def test_new
+ @request.session[:user_id] = 2
+ get :new, :project_id => 1
+ assert_response :success
+ assert_template 'new'
+
+ assert_tag 'select', :attributes => {:name => 'version_id'}
+ end
+
+ def test_new_without_versions
+ Version.delete_all
+ @request.session[:user_id] = 2
+ get :new, :project_id => 1
+ assert_response :success
+ assert_template 'new'
+
+ assert_no_tag 'select', :attributes => {:name => 'version_id'}
+ end
+
def test_create_file
set_tmp_attachments_directory
@request.session[:user_id] = 2