diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-02 10:50:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-02 10:50:31 +0000 |
commit | bea49ae24532284ca4ef9ce72733b78f77e480d5 (patch) | |
tree | af4cc8c8774e45178f737b7e3774979c04d13ffa /test/functional/journals_controller_test.rb | |
parent | 4abb82fd7bcdd2cdffdd8778a5d9e2fc6a3857dd (diff) | |
download | redmine-bea49ae24532284ca4ef9ce72733b78f77e480d5.tar.gz redmine-bea49ae24532284ca4ef9ce72733b78f77e480d5.zip |
Administrators can edit issue notes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1105 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/journals_controller_test.rb')
-rw-r--r-- | test/functional/journals_controller_test.rb | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb new file mode 100644 index 000000000..f231d10ee --- /dev/null +++ b/test/functional/journals_controller_test.rb @@ -0,0 +1,51 @@ +# redMine - project management software +# Copyright (C) 2006-2008 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 'journals_controller' + +# Re-raise errors caught by the controller. +class JournalsController; def rescue_action(e) raise e end; end + +class JournalsControllerTest < ActionController::TestCase + fixtures :projects, :users, :members, :roles, :issues, :journals, :journal_details, :enabled_modules + + def setup + @controller = JournalsController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + User.current = nil + end + + def test_get_edit + @request.session[:user_id] = 1 + xhr :get, :edit, :id => 2 + assert_response :success + assert_select_rjs :insert, :after, 'journal-2-notes' do + assert_select 'form[id=journal-2-form]' + assert_select 'textarea' + end + end + + def test_post_edit + @request.session[:user_id] = 1 + xhr :post, :edit, :id => 2, :notes => 'Updated notes' + assert_response :success + assert_select_rjs :replace, 'journal-2-notes' + assert_equal 'Updated notes', Journal.find(2).notes + end +end |