Commit 58768741 authored by maeda's avatar maeda

Remove trailing whitespaces from test (#31506).

Patch by Marius BALTEANU.


git-svn-id: https://svn.redmine.org/redmine/trunk@18233 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 4b69a5a6
......@@ -170,7 +170,7 @@ class AccountControllerOpenidTest < Redmine::ControllerTest
:lastname => 'User',
:mail => 'user@somedomain.com',
:identity_url => 'http://openid.example.com/good_blank_user'
}
}
assert_response 302
......
......@@ -312,7 +312,7 @@ class AccountControllerTest < Redmine::ControllerTest
:firstname => 'John',
:lastname => 'Doe',
:mail => 'register@example.com'
}
}
assert_redirected_to '/my/account'
......@@ -326,7 +326,7 @@ class AccountControllerTest < Redmine::ControllerTest
assert user.active?
end
end
def test_post_register_with_registration_off_should_redirect
with_settings :self_registration => '0' do
assert_no_difference 'User.count' do
......@@ -338,7 +338,7 @@ class AccountControllerTest < Redmine::ControllerTest
:firstname => 'John',
:lastname => 'Doe',
:mail => 'register@example.com'
}
}
assert_redirected_to '/'
......@@ -357,11 +357,11 @@ class AccountControllerTest < Redmine::ControllerTest
:firstname => 'John',
:lastname => 'Doe',
:mail => 'register@example.com'
},
},
:pref => {
:hide_mail => '1'
}
}
end
......
......@@ -143,7 +143,7 @@ class ActivitiesControllerTest < Redmine::ControllerTest
:show_issues => '1'
}
assert_response :success
assert_select 'title', :text => /Issues/
end
end
......
......@@ -31,7 +31,7 @@ class CommentsControllerTest < Redmine::ControllerTest
post :create, :params => {
:id => 1,
:comment => {
:comments => 'This is a test comment'
:comments => 'This is a test comment'
}
}
assert_redirected_to '/news/1'
......@@ -48,7 +48,7 @@ class CommentsControllerTest < Redmine::ControllerTest
post :create, :params => {
:id => 1,
:comment => {
:comments => ''
:comments => ''
}
}
assert_response :redirect
......@@ -63,7 +63,7 @@ class CommentsControllerTest < Redmine::ControllerTest
post :create, :params => {
:id => 1,
:comment => {
:comments => 'This is a test comment'
:comments => 'This is a test comment'
}
}
assert_response 403
......
......@@ -319,7 +319,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest
def test_time_entries_context_menu_without_edit_permission
@request.session[:user_id] = 2
Role.find_by_name('Manager').remove_permission! :edit_time_entries
get :time_entries, :params => {
:ids => [1, 2]
}
......
......@@ -47,7 +47,7 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
post :create, :params => {
:custom_field_id => @field.id,
:custom_field_enumeration => {
:name => 'Baz'
:name => 'Baz'
}
}
assert_redirected_to "/custom_fields/#{@field.id}/enumerations"
......@@ -65,7 +65,7 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
post :create, :params => {
:custom_field_id => @field.id,
:custom_field_enumeration => {
:name => 'Baz'
:name => 'Baz'
}
},
:xhr => true
......@@ -81,13 +81,13 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
:position => "1",
:name => "Baz",
:active => "1"
},
},
@foo.id.to_s => {
:position => "2",
:name => "Foo",
:active => "0"
}
}
}
}
assert_response 302
......
......@@ -193,7 +193,7 @@ class CustomFieldsControllerTest < Redmine::ControllerTest
:type => 'IssueCustomField',
:custom_field => {
:field_format => 'list'
},
},
:format => 'js'
},
:xhr => true
......@@ -247,7 +247,7 @@ class CustomFieldsControllerTest < Redmine::ControllerTest
:field_format => "string",
:is_for_all => "0",
:project_ids => ["1", "3", ""]
}
}
assert_response 302
......
......@@ -84,7 +84,7 @@ class FilesControllerTest < Redmine::ControllerTest
:version_id => '',
:attachments => {
'1' => {
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
assert_response :redirect
......@@ -111,7 +111,7 @@ class FilesControllerTest < Redmine::ControllerTest
:version_id => '2',
:attachments => {
'1' => {
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
assert_response :redirect
......
......@@ -102,7 +102,7 @@ class GroupsControllerTest < Redmine::ControllerTest
post :create, :params => {
:group => {
:name => 'New group'
},
},
:continue => 'Create and continue'
}
end
......
......@@ -125,7 +125,7 @@ class IssueCategoriesControllerTest < Redmine::ControllerTest
put :update, :params => {
:id => 2,
:issue_category => {
:name => 'Testing'
:name => 'Testing'
}
}
end
......@@ -137,7 +137,7 @@ class IssueCategoriesControllerTest < Redmine::ControllerTest
put :update, :params => {
:id => 2,
:issue_category => {
:name => ''
:name => ''
}
}
assert_response :success
......@@ -148,7 +148,7 @@ class IssueCategoriesControllerTest < Redmine::ControllerTest
put :update, :params => {
:id => 97,
:issue_category => {
:name => 'Testing'
:name => 'Testing'
}
}
assert_response 404
......
......@@ -32,13 +32,13 @@ class IssueStatusesControllerTest < Redmine::ControllerTest
assert_response :success
assert_select 'table.issue_statuses'
end
def test_index_by_anonymous_should_redirect_to_login_form
@request.session[:user_id] = nil
get :index
assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fissue_statuses'
end
def test_index_by_user_should_respond_with_406
@request.session[:user_id] = 2
get :index
......
......@@ -64,12 +64,12 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => 'My notes',
:lock_version => (issue.lock_version - 1)
},
},
:time_entry => {
:hours => '2.5',
:comments => '',
:activity_id => TimeEntryActivity.first.id
:activity_id => TimeEntryActivity.first.id
}
}
end
......@@ -100,16 +100,16 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => 'My notes',
:lock_version => (issue.lock_version - 1)
},
},
:attachments => {
'1' => {
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
},
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
},
:time_entry => {
:hours => '2.5',
:comments => '',
:activity_id => TimeEntryActivity.first.id
:activity_id => TimeEntryActivity.first.id
}
}
end
......@@ -133,7 +133,7 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => '',
:lock_version => (issue.lock_version - 1)
}
}
assert_response :success
......@@ -153,8 +153,8 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => '',
:lock_version => 2
},
},
:last_journal_id => 1
}
assert_response :success
......@@ -172,8 +172,8 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => '',
:lock_version => 2
},
},
:last_journal_id => ''
}
assert_response :success
......@@ -192,7 +192,7 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:issue => {
:fixed_version_id => 4,
:lock_version => 2
},
},
:last_journal_id => ''
}
assert_response :success
......@@ -204,7 +204,7 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:issue => {
:fixed_version_id => 4,
:lock_version => 2
},
},
:last_journal_id => ''
}
assert_response :success
......@@ -221,8 +221,8 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => 'overwrite_conflict_resolution',
:lock_version => 2
},
},
:conflict_resolution => 'overwrite'
}
end
......@@ -245,8 +245,8 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => 'add_notes_conflict_resolution',
:lock_version => 2
},
},
:conflict_resolution => 'add_notes'
}
end
......@@ -271,8 +271,8 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:notes => 'add_privates_notes_conflict_resolution',
:private_notes => '1',
:lock_version => 2
},
},
:conflict_resolution => 'add_notes'
}
end
......@@ -293,8 +293,8 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:fixed_version_id => 4,
:notes => 'add_notes_conflict_resolution',
:lock_version => 2
},
},
:conflict_resolution => 'cancel'
}
end
......@@ -311,12 +311,12 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
put :update, :params => {
:id => 1,
:issue => {
:subject => ''
},
:subject => ''
},
:time_entry => {
:hours => '2.5',
:comments => 'should not be added',
:activity_id => TimeEntryActivity.first.id
:activity_id => TimeEntryActivity.first.id
}
}
assert_response :success
......
......@@ -174,8 +174,8 @@ class IssuesCustomFieldsVisibilityTest < Redmine::ControllerTest
:id => @issue.id,
:issue => {
:custom_field_values => {
@field1.id.to_s => "User#{user.id}Value0",
@field2.id.to_s => "User#{user.id}Value1",
@field1.id.to_s => "User#{user.id}Value0",
@field2.id.to_s => "User#{user.id}Value1",
@field3.id.to_s => "User#{user.id}Value2",
}
}
......@@ -281,9 +281,9 @@ class IssuesCustomFieldsVisibilityTest < Redmine::ControllerTest
:priority_id => 5,
:custom_field_values => {
@field1.id.to_s => 'Value0', @field2.id.to_s => 'Value1', @field3.id.to_s => 'Value2'
},
},
:watcher_user_ids => users_to_test.keys.map(&:id)
}
}
assert_response 302
......@@ -321,8 +321,8 @@ class IssuesCustomFieldsVisibilityTest < Redmine::ControllerTest
:issue => {
:custom_field_values => {
@field1.id.to_s => 'NewValue0', @field2.id.to_s => 'NewValue1', @field3.id.to_s => 'NewValue2'
}
}
}
}
assert_response 302
......@@ -358,8 +358,8 @@ class IssuesCustomFieldsVisibilityTest < Redmine::ControllerTest
:issue => {
:custom_field_values => {
@field2.id.to_s => 'NewValue1', @field3.id.to_s => 'NewValue2'
}
}
}
}
assert_response 302
......
......@@ -118,7 +118,7 @@ class NewsControllerTest < Redmine::ControllerTest
:news => {
:title => 'NewsControllerTest',
:description => 'This is the description',
:summary => ''
:summary => ''
}
}
end
......@@ -141,11 +141,11 @@ class NewsControllerTest < Redmine::ControllerTest
:project_id => 1,
:news => {
:title => 'Test',
:description => 'This is the description'
},
:description => 'This is the description'
},
:attachments => {
'1' => {
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
end
......@@ -162,7 +162,7 @@ class NewsControllerTest < Redmine::ControllerTest
:news => {
:title => '',
:description => 'This is the description',
:summary => ''
:summary => ''
}
}
assert_response :success
......@@ -183,7 +183,7 @@ class NewsControllerTest < Redmine::ControllerTest
put :update, :params => {
:id => 1,
:news => {
:description => 'Description changed by test_post_edit'
:description => 'Description changed by test_post_edit'
}
}
assert_redirected_to '/news/1'
......@@ -199,11 +199,11 @@ class NewsControllerTest < Redmine::ControllerTest
put :update, :params => {
:id => 1,
:news => {
:description => 'This is the description'
},
:description => 'This is the description'
},
:attachments => {
'1' => {
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
'file' => uploaded_test_file('testfile.txt', 'text/plain')}
}
}
end
......@@ -217,7 +217,7 @@ class NewsControllerTest < Redmine::ControllerTest
put :update, :params => {
:id => 1,
:news => {
:description => ''
:description => ''
}
}
assert_response :success
......
......@@ -116,7 +116,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest
:membership => {
:project_ids => [3],
:role_ids => [2]
},
},
:format => 'js'
},
:xhr => true
......@@ -136,7 +136,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest
:user_id => 7,
:membership => {
:project_ids => [3]
},
},
:format => 'js'
},
:xhr => true
......@@ -186,7 +186,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest
:id => 1,
:membership => {
:role_ids => [2]
},
},
:format => 'js'
},
:xhr => true
......
......@@ -56,7 +56,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
assert_select 'option[value=Git]:not([selected])'
end
end
def test_get_new_with_type
@request.session[:user_id] = 1
get :new, :params => {
......
......@@ -63,7 +63,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest
:is_default => '0',
:identifier => 'test-create',
:report_last_commit => '1',
}
}
end
......@@ -77,7 +77,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest
:id => repository.id,
:repository => {
:report_last_commit => '0'
}
}
assert_response 302
......
......@@ -222,7 +222,7 @@ class RolesControllerTest < Redmine::ControllerTest
def test_destroy_role_in_use
delete :destroy, :params => {:id => 1}
assert_redirected_to '/roles'
assert_equal 'This role is in use and cannot be deleted.', flash[:error]
assert_equal 'This role is in use and cannot be deleted.', flash[:error]
assert_not_nil Role.find_by_id(1)
end
......
......@@ -33,7 +33,7 @@ class JournalsHelperTest < Redmine::HelperTest
def test_journal_thumbnail_attachments_should_return_thumbnailable_attachments
issue = Issue.generate!
journal = new_record(Journal) do
issue.init_journal(User.find(1))
issue.attachments << Attachment.new(:file => mock_file_with_options(:original_filename => 'image.png'), :author => User.find(1))
......
......@@ -60,14 +60,14 @@ class AccountTest < Redmine::IntegrationTest
assert_equal 'autologin', token.action
assert_equal user.id, session[:user_id]
assert_equal token.value, cookies['autologin']
# Session is cleared
reset!
User.current = nil
# Clears user's last login timestamp
user.update_attribute :last_login_on, nil
assert_nil user.reload.last_login_on
# User comes back with user's autologin cookie
cookies[:autologin] = token.value
get '/my/page'
......
......@@ -53,7 +53,7 @@ class AdminTest < Redmine::IntegrationTest
put "/users/#{user.id}", :params => {
:id => user.id,
:user => {
:status => User::STATUS_LOCKED
:status => User::STATUS_LOCKED
}
}
assert_redirected_to "/users/#{ user.id }/edit"
......
......@@ -97,7 +97,7 @@ class Redmine::ApiTest::IssueCategoriesTest < Redmine::ApiTest::Base
assert_equal '', @response.body
assert_nil IssueCategory.find_by_id(1)
end
test "DELETE /issue_categories/:id.xml should reassign issues with :reassign_to_id param" do
issue_count = Issue.where(:category_id => 1).count
assert issue_count > 0
......
......@@ -91,7 +91,7 @@ class Redmine::ApiTest::SearchTest < Redmine::ApiTest::Base
assert_equal 4, json['limit']
assert_equal issue[8..10], json['results'].map {|r| r['id']}
end
test "GET /search.xml should not quick jump to the issue with given id" do
get '/search.xml', :params => {:q => '3'}
assert_response :success
......
......@@ -130,7 +130,7 @@ class IssuesTest < Redmine::IntegrationTest
get '/projects/ecookbook/issues?set_filter=1&group_by=fixed_version&sort=priority:desc,fixed_version,id'
assert_response :success
assert_select 'td.id', :text => '5'
get '/issues/5'
assert_response :success
assert_select '.next-prev-links .position', :text => '5 of 6'
......@@ -142,7 +142,7 @@ class IssuesTest < Redmine::IntegrationTest
get '/projects/ecookbook/issues?set_filter=1&tracker_id=1'
assert_response :success
assert_select 'td.id', :text => '5'
get '/issues/5'
assert_response :success
assert_select '.next-prev-links .position', :text => '3 of 5'
......@@ -160,7 +160,7 @@ class IssuesTest < Redmine::IntegrationTest
get "/projects/ecookbook/issues?set_filter=1&query_id=#{query.id}"
assert_response :success
assert_select 'td.id', :text => '5'
get '/issues/5'
assert_response :success
assert_select '.next-prev-links .position', :text => '6 of 8'
......
......@@ -186,7 +186,7 @@ class SudoModeTest < Redmine::IntegrationTest
}
},
:headers => credentials('admin')
assert_response :created
end
end
......
......@@ -50,7 +50,7 @@ class IssuesTest < ApplicationSystemTestCase
# check issue attributes
assert_equal 'jsmith', issue.author.login
assert_equal 1, issue.project.id
assert_equal IssueStatus.find_by_name('New'), issue.status
assert_equal IssueStatus.find_by_name('New'), issue.status
assert_equal Tracker.find_by_name('Bug'), issue.tracker
assert_equal IssuePriority.find_by_name('Low'), issue.priority
assert_equal 'Value for field 2', issue.custom_field_value(CustomField.find_by_name('Searchable field'))
......@@ -291,9 +291,9 @@ class IssuesTest < ApplicationSystemTestCase
# Check that the page shows the Estimated hours total
assert page.has_css?('p.query-totals')
assert page.has_css?('span.total-for-estimated-hours')
# Open the Options of the form (necessary for having the totalable columns options clickable)
# Open the Options of the form (necessary for having the totalable columns options clickable)
page.all('legend')[1].click
# Deselect the default totalable column (none should be left)
# Deselect the default totalable column (none should be left)
page.first('input[name="t[]"][value="estimated_hours"]').click
within('#query_form') do
click_link 'Apply'
......
......@@ -35,7 +35,7 @@ class SudoModeTest < ApplicationSystemTestCase
def test_add_user
log_user('admin', 'admin')
expire_sudo_mode!
visit '/users/new'
assert_difference 'User.count' do
......
......@@ -64,7 +64,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
assert_equal 'clear', r.password
end
end
def test_ciphered_password_with_no_cipher_key_configured_should_be_returned_ciphered
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
r = Repository::Subversion.create!(:password => 'clear', :url => 'file:///tmp', :identifier => 'svn')
......
......@@ -73,7 +73,7 @@ class Redmine::VersionFieldFormatTest < ActionView::TestCase
assert_equal expected, field.possible_values_options(project).map(&:first)
end
def test_possible_values_options_should_return_system_shared_versions_without_project
field = IssueCustomField.new(:field_format => 'version')
version = Version.generate!(:project => Project.find(1), :status => 'open', :sharing => 'system')
......
......@@ -70,7 +70,7 @@ class Redmine::I18nTest < ActiveSupport::TestCase
end
assert l('date.day_names').is_a?(Array)
assert_equal 7, l('date.day_names').size
assert l('date.month_names').is_a?(Array)
assert_equal 13, l('date.month_names').size
end
......
......@@ -211,7 +211,7 @@ class Redmine::MenuManager::MenuHelperTest < Redmine::HelperTest
end
end
end
def test_render_empty_virtual_menu_node_with_children
# only empty item with no click target
......
......@@ -77,22 +77,22 @@ class GitAdapterTest < ActiveSupport::TestCase
end
assert_equal 8, brs.length
br_issue_8857 = brs[0]
assert_equal 'issue-8857', br_issue_8857.to_s
assert_equal 'issue-8857', br_issue_8857.to_s
assert_equal '2a682156a3b6e77a8bf9cd4590e8db757f3c6c78', br_issue_8857.revision
assert_equal br_issue_8857.scmid, br_issue_8857.revision
assert_equal false, br_issue_8857.is_default
br_latin_1_branch1 = brs[1]
assert_equal "latin-1-branch-#{@char_1}-01", br_latin_1_branch1.to_s
assert_equal "latin-1-branch-#{@char_1}-01", br_latin_1_branch1.to_s
assert_equal '4fc55c43bf3d3dc2efb66145365ddc17639ce81e', br_latin_1_branch1.revision
assert_equal br_latin_1_branch1.scmid, br_latin_1_branch1.revision
assert_equal false, br_latin_1_branch1.is_default
br_latin_1_branch2 = brs[2]
assert_equal "latin-1-branch-#{@char_1}-02", br_latin_1_branch2.to_s
assert_equal "latin-1-branch-#{@char_1}-02", br_latin_1_branch2.to_s
assert_equal '1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127', br_latin_1_branch2.revision
assert_equal br_latin_1_branch2.scmid, br_latin_1_branch2.revision
assert_equal false, br_latin_1_branch2.is_default
br_latin_1_path = brs[3]