diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 58d6115..5ad3d69 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -48,7 +48,7 @@ class AdminController < ApplicationController def mail_options @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted) if request.post? - settings = (params[:settings] || {}).dup + settings = (params[:settings] || {}).dup.symbolize_keys settings[:notified_events] ||= [] settings.each { |name, value| Setting[name] = value } flash[:notice] = l(:notice_successful_update) diff --git a/doc/RUNNING_TESTS b/doc/RUNNING_TESTS index bd72ac7..eb8787d 100644 --- a/doc/RUNNING_TESTS +++ b/doc/RUNNING_TESTS @@ -8,6 +8,10 @@ Subversion svnadmin create tmp/test/subversion_repository gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load tmp/test/subversion_repository +CVS +--- +gunzip < test/fixtures/repositories/cvs_repository.tar.gz | tar -xv -C tmp/test + Bazaar ------ gunzip < test/fixtures/repositories/bazaar_repository.tar.gz | tar -xv -C tmp/test \ No newline at end of file diff --git a/test/fixtures/repositories/cvs_repository.tar.gz b/test/fixtures/repositories/cvs_repository.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..638b166b5e8ef53821313bb1e3f4e5ecb4637377 GIT binary patch literal 12248 zc${6@gLmCcyEpJ18%<*yjh)7g(U=VyHnzQETaDG&P8!=bnxwI9?caOf&vVXN?>hg% zteI=BneS(YED8~^($7d5gks|6Y~b|6!QR=@#oo!2#l^@8bgu8|ye?Hg-L0*QY;!PUjl@kVmkt1XS8L0`Env z8gK8nWHTBdDK%{{tDSDc0k+S*skRH{i<%YO;P>_OP#wVRwsh0~-kxNU&>-B3mP#-2 z;`s$kQw^_*y<4G=Ei|6mcLO&O!2qrGv^zU;4{elIjH6v`va%!PCHzLyR{hbV+E)H{ zyt9V9f5s^fc^a{jNcR4z&uL&eqk5s6rnFuFGn5tjGx4fa-i>A+RwcsgLW7_PCRTYa zqQwYi^S*Ko>ewm1ID;JmuDY}JYV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0 Hc$@ 2 + assert_response :success + assert_template 'show' + assert_not_nil assigns(:user) + end + + def test_show_inactive + get :show, :id => 5 + assert_response 404 + assert_nil assigns(:user) + end + + def test_login_with_wrong_password + post :login, :login => 'admin', :password => 'bad' + assert_response :success + assert_template 'login' + assert_tag 'div', + :attributes => { :class => "flash error" }, + :content => /Invalid user or password/ + end + + def test_autologin + Setting.autologin = "7" + Token.delete_all + post :login, :login => 'admin', :password => 'admin', :autologin => 1 + assert_redirected_to 'my/page' + token = Token.find :first + assert_not_nil token + assert_equal User.find_by_login('admin'), token.user + assert_equal 'autologin', token.action + end + + def test_logout + @request.session[:user_id] = 2 + get :logout + assert_redirected_to '' + assert_nil @request.session[:user_id] + end +end diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb new file mode 100644 index 0000000..d49fe2d --- /dev/null +++ b/test/functional/admin_controller_test.rb @@ -0,0 +1,61 @@ +# redMine - project management software +# Copyright (C) 2006-2007 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' +require 'admin_controller' + +# Re-raise errors caught by the controller. +class AdminController; def rescue_action(e) raise e end; end + +class AdminControllerTest < Test::Unit::TestCase + fixtures :projects, :users + + def setup + @controller = AdminController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + User.current = nil + @request.session[:user_id] = 1 # admin + end + + def test_get_mail_options + get :mail_options + assert_response :success + assert_template 'mail_options' + end + + def test_post_mail_options + post :mail_options, :settings => {'mail_from' => 'functional@test.foo'} + assert_redirected_to 'admin/mail_options' + assert_equal 'functional@test.foo', Setting.mail_from + end + + def test_test_email + get :test_email + assert_redirected_to 'admin/mail_options' + mail = ActionMailer::Base.deliveries.last + assert_kind_of TMail::Mail, mail + user = User.find(1) + assert_equal [user.mail], mail.bcc + end + + def test_info + get :info + assert_response :success + assert_template 'info' + end +end diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index b9d232b..638362d 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -22,7 +22,17 @@ require 'issues_controller' class IssuesController; def rescue_action(e) raise e end; end class IssuesControllerTest < Test::Unit::TestCase - fixtures :projects, :users, :roles, :members, :issues, :enabled_modules, :enumerations + fixtures :projects, + :users, + :roles, + :members, + :issues, + :issue_statuses, + :trackers, + :issue_categories, + :enabled_modules, + :enumerations, + :attachments def setup @controller = IssuesController.new diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index 25fc136..dcfe0ca 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -40,10 +40,60 @@ class MessagesControllerTest < Test::Unit::TestCase assert_not_nil assigns(:topic) end + def test_show_message_not_found + get :show, :board_id => 1, :id => 99999 + assert_response 404 + end + + def test_get_new + @request.session[:user_id] = 2 + get :new, :board_id => 1 + assert_response :success + assert_template 'new' + end + + def test_post_new + @request.session[:user_id] = 2 + post :new, :board_id => 1, + :message => { :subject => 'Test created message', + :content => 'Message body'} + assert_redirected_to 'messages/show' + message = Message.find_by_subject('Test created message') + assert_not_nil message + assert_equal 'Message body', message.content + assert_equal 2, message.author_id + assert_equal 1, message.board_id + end + + def test_get_edit + @request.session[:user_id] = 2 + get :edit, :board_id => 1, :id => 1 + assert_response :success + assert_template 'edit' + end + + def test_post_edit + @request.session[:user_id] = 2 + post :edit, :board_id => 1, :id => 1, + :message => { :subject => 'New subject', + :content => 'New body'} + assert_redirected_to 'messages/show' + message = Message.find(1) + assert_equal 'New subject', message.subject + assert_equal 'New body', message.content + end + def test_reply @request.session[:user_id] = 2 post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' } assert_redirected_to 'messages/show' assert Message.find_by_subject('Test reply') end + + def test_destroy_topic + @request.session[:user_id] = 2 + post :destroy, :board_id => 1, :id => 1 + assert_redirected_to 'boards/show' + assert_nil Message.find_by_id(1) + end end diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 5df2932..c1349ac 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -22,7 +22,7 @@ require 'my_controller' class MyController; def rescue_action(e) raise e end; end class MyControllerTest < Test::Unit::TestCase - fixtures :users + fixtures :users, :issues, :issue_statuses, :trackers, :enumerations def setup @controller = MyController.new diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index 9cc7048..d7ce456 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -21,7 +21,7 @@ require 'repositories_controller' # Re-raise errors caught by the controller. class RepositoriesController; def rescue_action(e) raise e end; end -class RepositoriesControllerTest < Test::Unit::TestCase +class RepositoriesSubversionControllerTest < Test::Unit::TestCase fixtures :projects, :users, :roles, :members, :repositories, :issues, :issue_statuses, :changesets, :changes, :issue_categories, :enumerations, :custom_fields, :custom_values, :trackers # No '..' in the repository path for svn diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb new file mode 100644 index 0000000..8629a71 --- /dev/null +++ b/test/functional/users_controller_test.rb @@ -0,0 +1,62 @@ +# redMine - project management software +# Copyright (C) 2006-2007 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' +require 'users_controller' + +# Re-raise errors caught by the controller. +class UsersController; def rescue_action(e) raise e end; end + +class UsersControllerTest < Test::Unit::TestCase + fixtures :users, :projects, :members + + def setup + @controller = UsersController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + User.current = nil + @request.session[:user_id] = 1 # admin + end + + def test_index + get :index + assert_response :success + assert_template 'list' + end + + def test_list + get :list + assert_response :success + assert_template 'list' + assert_not_nil assigns(:users) + # active users only + assert_nil assigns(:users).detect {|u| !u.active?} + end + + def test_edit_membership + post :edit_membership, :id => 2, :membership_id => 1, + :membership => { :role_id => 2} + assert_redirected_to 'users/edit/2' + assert_equal 2, Member.find(1).role_id + end + + def test_destroy_membership + post :destroy_membership, :id => 2, :membership_id => 1 + assert_redirected_to 'users/edit/2' + assert_nil Member.find_by_id(1) + end +end diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index e832793..17ebd35 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -39,4 +39,35 @@ class VersionsControllerTest < Test::Unit::TestCase assert_tag :tag => 'h2', :content => /1.0/ end + + def test_get_edit + @request.session[:user_id] = 2 + get :edit, :id => 2 + assert_response :success + assert_template 'edit' + end + + def test_post_edit + @request.session[:user_id] = 2 + post :edit, :id => 2, + :version => { :name => 'New version name', + :effective_date => Date.today.strftime("%Y-%m-%d")} + assert_redirected_to 'projects/settings/1' + version = Version.find(2) + assert_equal 'New version name', version.name + assert_equal Date.today, version.effective_date + end + + def test_destroy + @request.session[:user_id] = 2 + post :destroy, :id => 2 + assert_redirected_to 'projects/settings/1' + assert_nil Version.find_by_id(2) + end + + def test_issue_status_by + xhr :get, :status_by, :id => 2 + assert_response :success + assert_template '_issue_counts' + end end diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb new file mode 100644 index 0000000..18146c6 --- /dev/null +++ b/test/functional/welcome_controller_test.rb @@ -0,0 +1,49 @@ +# redMine - project management software +# Copyright (C) 2006-2007 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' +require 'welcome_controller' + +# Re-raise errors caught by the controller. +class WelcomeController; def rescue_action(e) raise e end; end + +class WelcomeControllerTest < Test::Unit::TestCase + fixtures :projects, :news + + def setup + @controller = WelcomeController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + User.current = nil + end + + def test_index + get :index + assert_response :success + assert_template 'index' + assert_not_nil assigns(:news) + assert_not_nil assigns(:projects) + assert !assigns(:projects).include?(Project.find(:first, :conditions => {:is_public => false})) + end + + def test_browser_language + Setting.default_language = 'en' + @request.env['HTTP_ACCEPT_LANGUAGE'] = 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' + get :index + assert_equal :fr, @controller.current_language + end +end diff --git a/test/unit/repository_cvs_test.rb b/test/unit/repository_cvs_test.rb new file mode 100644 index 0000000..3f6db06 --- /dev/null +++ b/test/unit/repository_cvs_test.rb @@ -0,0 +1,60 @@ +# redMine - project management software +# Copyright (C) 2006-2007 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' +require 'pp' +class RepositoryCvsTest < Test::Unit::TestCase + fixtures :projects + + # No '..' in the repository path + REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/cvs_repository' + REPOSITORY_PATH.gsub!(/\//, "\\") if RUBY_PLATFORM =~ /mswin/ + # CVS module + MODULE_NAME = 'test' + + def setup + @project = Project.find(1) + assert @repository = Repository::Cvs.create(:project => @project, + :root_url => REPOSITORY_PATH, + :url => MODULE_NAME) + end + + if File.directory?(REPOSITORY_PATH) + def test_fetch_changesets_from_scratch + @repository.fetch_changesets + @repository.reload + + assert_equal 5, @repository.changesets.count + assert_equal 14, @repository.changes.count + assert_equal 'Two files changed', @repository.changesets.find_by_revision(3).comments + end + + def test_fetch_changesets_incremental + @repository.fetch_changesets + # Remove changesets with revision > 2 + @repository.changesets.find(:all, :conditions => 'revision > 2').each(&:destroy) + @repository.reload + assert_equal 2, @repository.changesets.count + + @repository.fetch_changesets + assert_equal 5, @repository.changesets.count + end + else + puts "CVS test repository NOT FOUND. Skipping unit tests !!!" + def test_fake; assert true end + end +end