Browse Source

remove trailing white-spaces from test/functional/news_controller_test.rb.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6830 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/1.3.0
Toshi MARUYAMA 13 years ago
parent
commit
4f6286b86a
1 changed files with 15 additions and 15 deletions
  1. 15
    15
      test/functional/news_controller_test.rb

+ 15
- 15
test/functional/news_controller_test.rb View File

# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


class NewsControllerTest < ActionController::TestCase class NewsControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news, :comments fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news, :comments
def setup def setup
@controller = NewsController.new @controller = NewsController.new
@request = ActionController::TestRequest.new @request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new @response = ActionController::TestResponse.new
User.current = nil User.current = nil
end end
def test_index def test_index
get :index get :index
assert_response :success assert_response :success
assert_not_nil assigns(:newss) assert_not_nil assigns(:newss)
assert_nil assigns(:project) assert_nil assigns(:project)
end end
def test_index_with_project def test_index_with_project
get :index, :project_id => 1 get :index, :project_id => 1
assert_response :success assert_response :success
assert_template 'index' assert_template 'index'
assert_not_nil assigns(:newss) assert_not_nil assigns(:newss)
end end
def test_show def test_show
get :show, :id => 1 get :show, :id => 1
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_tag :tag => 'h2', :content => /eCookbook first release/ assert_tag :tag => 'h2', :content => /eCookbook first release/
end end
def test_show_not_found def test_show_not_found
get :show, :id => 999 get :show, :id => 999
assert_response 404 assert_response 404
end end
def test_get_new def test_get_new
@request.session[:user_id] = 2 @request.session[:user_id] = 2
get :new, :project_id => 1 get :new, :project_id => 1
assert_response :success assert_response :success
assert_template 'new' assert_template 'new'
end end
def test_post_create def test_post_create
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
Setting.notified_events << 'news_added' Setting.notified_events << 'news_added'
:description => 'This is the description', :description => 'This is the description',
:summary => '' } :summary => '' }
assert_redirected_to '/projects/ecookbook/news' assert_redirected_to '/projects/ecookbook/news'
news = News.find_by_title('NewsControllerTest') news = News.find_by_title('NewsControllerTest')
assert_not_nil news assert_not_nil news
assert_equal 'This is the description', news.description assert_equal 'This is the description', news.description
assert_equal Project.find(1), news.project assert_equal Project.find(1), news.project
assert_equal 1, ActionMailer::Base.deliveries.size assert_equal 1, ActionMailer::Base.deliveries.size
end end
def test_get_edit def test_get_edit
@request.session[:user_id] = 2 @request.session[:user_id] = 2
get :edit, :id => 1 get :edit, :id => 1
assert_response :success assert_response :success
assert_template 'edit' assert_template 'edit'
end end
def test_put_update def test_put_update
@request.session[:user_id] = 2 @request.session[:user_id] = 2
put :update, :id => 1, :news => { :description => 'Description changed by test_post_edit' } put :update, :id => 1, :news => { :description => 'Description changed by test_post_edit' }
assert_tag :tag => 'div', :attributes => { :id => 'errorExplanation' }, assert_tag :tag => 'div', :attributes => { :id => 'errorExplanation' },
:content => /1 error/ :content => /1 error/
end end
def test_destroy def test_destroy
@request.session[:user_id] = 2 @request.session[:user_id] = 2
delete :destroy, :id => 1 delete :destroy, :id => 1

Loading…
Cancel
Save