remove trailing white-spaces from test/integration/issues_test.rb.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6654 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-08-27 02:10:59 +00:00
parent db8beabfa3
commit 4b60e577ca
1 changed files with 29 additions and 29 deletions

View File

@ -5,12 +5,12 @@
# 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.
@ -18,7 +18,7 @@
require File.expand_path('../../test_helper', __FILE__) require File.expand_path('../../test_helper', __FILE__)
class IssuesTest < ActionController::IntegrationTest class IssuesTest < ActionController::IntegrationTest
fixtures :projects, fixtures :projects,
:users, :users,
:roles, :roles,
:members, :members,
@ -38,13 +38,13 @@ class IssuesTest < ActionController::IntegrationTest
get 'projects/1/issues/new', :tracker_id => '1' get 'projects/1/issues/new', :tracker_id => '1'
assert_response :success assert_response :success
assert_template 'issues/new' assert_template 'issues/new'
post 'projects/1/issues', :tracker_id => "1", post 'projects/1/issues', :tracker_id => "1",
:issue => { :start_date => "2006-12-26", :issue => { :start_date => "2006-12-26",
:priority_id => "4", :priority_id => "4",
:subject => "new test issue", :subject => "new test issue",
:category_id => "", :category_id => "",
:description => "new issue", :description => "new issue",
:done_ratio => "0", :done_ratio => "0",
:due_date => "", :due_date => "",
:assigned_to_id => "" }, :assigned_to_id => "" },
@ -58,7 +58,7 @@ class IssuesTest < ActionController::IntegrationTest
follow_redirect! follow_redirect!
assert_equal issue, assigns(:issue) assert_equal issue, assigns(:issue)
# check issue attributes # check issue attributes
assert_equal 'jsmith', issue.author.login assert_equal 'jsmith', issue.author.login
assert_equal 1, issue.project.id assert_equal 1, issue.project.id
assert_equal 1, issue.status.id assert_equal 1, issue.status.id
@ -73,7 +73,7 @@ class IssuesTest < ActionController::IntegrationTest
:notes => 'Some notes', :notes => 'Some notes',
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}} :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}}
assert_redirected_to "/issues/1" assert_redirected_to "/issues/1"
# make sure attachment was saved # make sure attachment was saved
attachment = Issue.find(1).attachments.find_by_filename("testfile.txt") attachment = Issue.find(1).attachments.find_by_filename("testfile.txt")
assert_kind_of Attachment, attachment assert_kind_of Attachment, attachment
@ -83,56 +83,56 @@ class IssuesTest < ActionController::IntegrationTest
#assert_equal file_data_1.length, attachment.filesize #assert_equal file_data_1.length, attachment.filesize
# verify that the attachment was written to disk # verify that the attachment was written to disk
assert File.exist?(attachment.diskfile) assert File.exist?(attachment.diskfile)
# remove the attachments # remove the attachments
Issue.find(1).attachments.each(&:destroy) Issue.find(1).attachments.each(&:destroy)
assert_equal 0, Issue.find(1).attachments.length assert_equal 0, Issue.find(1).attachments.length
end end
def test_other_formats_links_on_get_index def test_other_formats_links_on_get_index
get '/projects/ecookbook/issues' get '/projects/ecookbook/issues'
%w(Atom PDF CSV).each do |format| %w(Atom PDF CSV).each do |format|
assert_tag :a, :content => format, assert_tag :a, :content => format,
:attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}",
:rel => 'nofollow' } :rel => 'nofollow' }
end end
end end
def test_other_formats_links_on_post_index_without_project_id_in_url def test_other_formats_links_on_post_index_without_project_id_in_url
post '/issues', :project_id => 'ecookbook' post '/issues', :project_id => 'ecookbook'
%w(Atom PDF CSV).each do |format| %w(Atom PDF CSV).each do |format|
assert_tag :a, :content => format, assert_tag :a, :content => format,
:attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}",
:rel => 'nofollow' } :rel => 'nofollow' }
end end
end end
def test_pagination_links_on_get_index def test_pagination_links_on_get_index
Setting.per_page_options = '2' Setting.per_page_options = '2'
get '/projects/ecookbook/issues' get '/projects/ecookbook/issues'
assert_tag :a, :content => '2', assert_tag :a, :content => '2',
:attributes => { :href => '/projects/ecookbook/issues?page=2' } :attributes => { :href => '/projects/ecookbook/issues?page=2' }
end end
def test_pagination_links_on_post_index_without_project_id_in_url def test_pagination_links_on_post_index_without_project_id_in_url
Setting.per_page_options = '2' Setting.per_page_options = '2'
post '/issues', :project_id => 'ecookbook' post '/issues', :project_id => 'ecookbook'
assert_tag :a, :content => '2', assert_tag :a, :content => '2',
:attributes => { :href => '/projects/ecookbook/issues?page=2' } :attributes => { :href => '/projects/ecookbook/issues?page=2' }
end end
def test_issue_with_user_custom_field def test_issue_with_user_custom_field
@field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true, :trackers => Tracker.all) @field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true, :trackers => Tracker.all)
Role.anonymous.add_permission! :add_issues, :edit_issues Role.anonymous.add_permission! :add_issues, :edit_issues
users = Project.find(1).users users = Project.find(1).users
tester = users.first tester = users.first
# Issue form # Issue form
get '/projects/ecookbook/issues/new' get '/projects/ecookbook/issues/new'
assert_response :success assert_response :success
@ -144,10 +144,10 @@ class IssuesTest < ActionController::IntegrationTest
:attributes => {:value => tester.id.to_s}, :attributes => {:value => tester.id.to_s},
:content => tester.name :content => tester.name
} }
# Create issue # Create issue
assert_difference 'Issue.count' do assert_difference 'Issue.count' do
post '/projects/ecookbook/issues', post '/projects/ecookbook/issues',
:issue => { :issue => {
:tracker_id => '1', :tracker_id => '1',
:priority_id => '4', :priority_id => '4',
@ -157,7 +157,7 @@ class IssuesTest < ActionController::IntegrationTest
end end
issue = Issue.first(:order => 'id DESC') issue = Issue.first(:order => 'id DESC')
assert_response 302 assert_response 302
# Issue view # Issue view
follow_redirect! follow_redirect!
assert_tag :th, assert_tag :th,
@ -174,7 +174,7 @@ class IssuesTest < ActionController::IntegrationTest
:attributes => {:value => tester.id.to_s, :selected => 'selected'}, :attributes => {:value => tester.id.to_s, :selected => 'selected'},
:content => tester.name :content => tester.name
} }
# Update issue # Update issue
new_tester = users[1] new_tester = users[1]
assert_difference 'Journal.count' do assert_difference 'Journal.count' do
@ -185,7 +185,7 @@ class IssuesTest < ActionController::IntegrationTest
} }
end end
assert_response 302 assert_response 302
# Issue view # Issue view
follow_redirect! follow_redirect!
assert_tag :content => 'Tester', assert_tag :content => 'Tester',