##// END OF EJS Templates
Fixed that activities option tags on the time entry bulk edit form are escaped....
Fixed that activities option tags on the time entry bulk edit form are escaped. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9643 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r8966:3aaf2b9ed007
r9460:ee8dcab9db0a
Show More
files_controller_test.rb
96 lines | 3.0 KiB | text/x-ruby | RubyLexer
/ test / functional / files_controller_test.rb
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Eric Davis
Refactor: move method, ProjectsController#list_files to FilesController#index....
r3937
class FilesControllerTest < ActionController::TestCase
Toshi MARUYAMA
Rails3: replace "all" fixtures at test/functional/files_controller_test.rb...
r7402 fixtures :projects, :trackers, :issue_statuses, :issues,
:enumerations, :users, :issue_categories,
:projects_trackers,
:roles,
:member_roles,
:members,
:enabled_modules,
:workflows,
:journals, :journal_details,
:attachments,
:versions
Toshi MARUYAMA
remove trailing white-spaces from test/functional/files_controller_test.rb....
r6698
Eric Davis
Refactor: move method, ProjectsController#list_files to FilesController#index....
r3937 def setup
@controller = FilesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@request.session[:user_id] = nil
Setting.default_language = 'en'
end
def test_index
Eric Davis
Refactor: convert FilesController to a restful resource....
r3971 get :index, :project_id => 1
Eric Davis
Refactor: move method, ProjectsController#list_files to FilesController#index....
r3937 assert_response :success
assert_template 'index'
assert_not_nil assigns(:containers)
Toshi MARUYAMA
remove trailing white-spaces from test/functional/files_controller_test.rb....
r6698
Eric Davis
Refactor: move method, ProjectsController#list_files to FilesController#index....
r3937 # file attached to the project
assert_tag :a, :content => 'project_file.zip',
:attributes => { :href => '/attachments/download/8/project_file.zip' }
Toshi MARUYAMA
remove trailing white-spaces from test/functional/files_controller_test.rb....
r6698
Eric Davis
Refactor: move method, ProjectsController#list_files to FilesController#index....
r3937 # file attached to a project's version
assert_tag :a, :content => 'version_file.zip',
:attributes => { :href => '/attachments/download/9/version_file.zip' }
end
Jean-Philippe Lang
Adds functional tests....
r8834 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
Eric Davis
Refactor: split FilesController#new into #new and #create....
r3970 def test_create_file
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 set_tmp_attachments_directory
@request.session[:user_id] = 2
Setting.notified_events = ['file_added']
ActionMailer::Base.deliveries.clear
Toshi MARUYAMA
remove trailing white-spaces from test/functional/files_controller_test.rb....
r6698
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 assert_difference 'Attachment.count' do
Eric Davis
Refactor: convert FilesController to a restful resource....
r3971 post :create, :project_id => 1, :version_id => '',
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_response :redirect
end
Jean-Philippe Lang
Adds leading slash to all assert_redirected_to arguments (#6887)....
r4293 assert_redirected_to '/projects/ecookbook/files'
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 a = Attachment.find(:first, :order => 'created_on DESC')
assert_equal 'testfile.txt', a.filename
assert_equal Project.find(1), a.container
mail = ActionMailer::Base.deliveries.last
Jean-Philippe Lang
Do not do assertions on mail class....
r8871 assert_not_nil mail
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 assert_equal "[eCookbook] New file", mail.subject
Jean-Philippe Lang
Adds helpers for testing email body....
r8966 assert_mail_body_match 'testfile.txt', mail
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 end
Toshi MARUYAMA
remove trailing white-spaces from test/functional/files_controller_test.rb....
r6698
Eric Davis
Refactor: split FilesController#new into #new and #create....
r3970 def test_create_version_file
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 set_tmp_attachments_directory
@request.session[:user_id] = 2
Setting.notified_events = ['file_added']
Toshi MARUYAMA
remove trailing white-spaces from test/functional/files_controller_test.rb....
r6698
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 assert_difference 'Attachment.count' do
Eric Davis
Refactor: convert FilesController to a restful resource....
r3971 post :create, :project_id => 1, :version_id => '2',
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_response :redirect
end
Jean-Philippe Lang
Adds leading slash to all assert_redirected_to arguments (#6887)....
r4293 assert_redirected_to '/projects/ecookbook/files'
Eric Davis
Refactor: move method, ProjectsController#add_file to FilesController#new....
r3938 a = Attachment.find(:first, :order => 'created_on DESC')
assert_equal 'testfile.txt', a.filename
assert_equal Version.find(2), a.container
end
Toshi MARUYAMA
remove trailing white-spaces from test/functional/files_controller_test.rb....
r6698
Eric Davis
Refactor: move method, ProjectsController#list_files to FilesController#index....
r3937 end