]> source.dussan.org Git - redmine.git/commitdiff
Adds functional tests.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 23 Feb 2012 15:41:29 +0000 (15:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 23 Feb 2012 15:41:29 +0000 (15:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8954 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/files_controller_test.rb

index ce61a85f1c78fea4c5c57314cea4b9c23295f928..3cd0bfc013e08fb685536d5831acfac84c5202e4 100644 (file)
@@ -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