mirror of
				https://github.com/redmine/redmine.git
				synced 2025-10-31 02:15:52 +01:00 
			
		
		
		
	Remove trailing whitespaces from test (#31506).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18233 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
		| @@ -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] | ||||
|       assert_equal 'latin-1-path-encoding', br_latin_1_path.to_s  | ||||
|       assert_equal 'latin-1-path-encoding', br_latin_1_path.to_s | ||||
|       assert_equal '1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127', br_latin_1_path.revision | ||||
|       assert_equal br_latin_1_path.scmid, br_latin_1_path.revision | ||||
|       assert_equal false, br_latin_1_path.is_default | ||||
|   | ||||
| @@ -123,13 +123,13 @@ DIFF | ||||
| --- file.c | ||||
| ------------------------- | ||||
| +A line that starts with dashes: | ||||
|   | ||||
|  | ||||
|  and removed. | ||||
|   | ||||
|  | ||||
| @@ -23,4 +19,4 @@ | ||||
|   | ||||
|   | ||||
|   | ||||
|  | ||||
|  | ||||
|  | ||||
| -Another chunk of change | ||||
| +Another chunk of changes | ||||
|  | ||||
| @@ -360,7 +360,7 @@ DIFF | ||||
|   end | ||||
|  | ||||
|   def test_offset_range_japanese_4 | ||||
|     # UTF-8 The 2nd byte differs.  | ||||
|     # UTF-8 The 2nd byte differs. | ||||
|     with_settings :repositories_encodings => '' do | ||||
|       diff = Redmine::UnifiedDiff.new( | ||||
|                read_diff_fixture('issue-13644-4.diff'), :type => 'sbs') | ||||
| @@ -372,7 +372,7 @@ DIFF | ||||
|   end | ||||
|  | ||||
|   def test_offset_range_japanese_5 | ||||
|     # UTF-8 The 2nd byte differs.  | ||||
|     # UTF-8 The 2nd byte differs. | ||||
|     with_settings :repositories_encodings => '' do | ||||
|       diff = Redmine::UnifiedDiff.new( | ||||
|                read_diff_fixture('issue-13644-5.diff'), :type => 'sbs') | ||||
|   | ||||
| @@ -89,7 +89,7 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest | ||||
|  | ||||
|   def test_multiple_macros_on_the_same_line | ||||
|     Redmine::WikiFormatting::Macros.macro :foo do |obj, args| | ||||
|       args.any? ? "args: #{args.join(',')}" : "no args"  | ||||
|       args.any? ? "args: #{args.join(',')}" : "no args" | ||||
|     end | ||||
|  | ||||
|     assert_equal '<p>no args no args</p>', textilizable("{{foo}} {{foo}}") | ||||
| @@ -212,7 +212,7 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest | ||||
|     text = "{{collapse\n*Collapsed* block of text\n}}" | ||||
|     with_locale 'en' do | ||||
|       result = textilizable(text) | ||||
|    | ||||
|  | ||||
|       assert_select_in result, 'div.collapsed-text' | ||||
|       assert_select_in result, 'strong', :text => 'Collapsed' | ||||
|       assert_select_in result, 'a.collapsible.collapsed', :text => 'Show' | ||||
| @@ -249,7 +249,7 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest | ||||
| h1. Title | ||||
|  | ||||
| {{collapse(Show example, Hide example) | ||||
| h2. Heading  | ||||
| h2. Heading | ||||
| }}" | ||||
| RAW | ||||
|  | ||||
|   | ||||
| @@ -281,7 +281,7 @@ EXPECTED | ||||
| This is a table with trailing whitespace in one row: | ||||
|  | ||||
| |cell11|cell12| | ||||
| |cell21|cell22|  | ||||
| |cell21|cell22| | ||||
| |cell31|cell32| | ||||
| RAW | ||||
|  | ||||
| @@ -383,8 +383,8 @@ EXPECTED | ||||
|     expected = '<p><img src="/images/comment.png"onclick=&#x61;&#x6c;&#x65;&#x72;&#x74;&#x28;&#x27;&#x58;&#x53;&#x53;&#x27;&#x29;;&#x22;" alt="" /></p>' | ||||
|     assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '') | ||||
|   end | ||||
|    | ||||
|    | ||||
|  | ||||
|  | ||||
|   STR_WITHOUT_PRE = [ | ||||
|   # 0 | ||||
| "h1. Title | ||||
| @@ -414,36 +414,36 @@ Praesent eget turpis nibh, a lacinia nulla.", | ||||
| Ut rhoncus elementum adipiscing."] | ||||
|  | ||||
|   TEXT_WITHOUT_PRE = STR_WITHOUT_PRE.join("\n\n").freeze | ||||
|    | ||||
|  | ||||
|   def test_get_section_should_return_the_requested_section_and_its_hash | ||||
|     assert_section_with_hash STR_WITHOUT_PRE[1], TEXT_WITHOUT_PRE, 2 | ||||
|     assert_section_with_hash STR_WITHOUT_PRE[2..3].join("\n\n"), TEXT_WITHOUT_PRE, 3 | ||||
|     assert_section_with_hash STR_WITHOUT_PRE[3], TEXT_WITHOUT_PRE, 5 | ||||
|     assert_section_with_hash STR_WITHOUT_PRE[4], TEXT_WITHOUT_PRE, 6 | ||||
|      | ||||
|  | ||||
|     assert_section_with_hash '', TEXT_WITHOUT_PRE, 0 | ||||
|     assert_section_with_hash '', TEXT_WITHOUT_PRE, 10 | ||||
|   end | ||||
|    | ||||
|  | ||||
|   def test_update_section_should_update_the_requested_section | ||||
|     replacement = "New text" | ||||
|      | ||||
|  | ||||
|     assert_equal [STR_WITHOUT_PRE[0], replacement, STR_WITHOUT_PRE[2..4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(2, replacement) | ||||
|     assert_equal [STR_WITHOUT_PRE[0..1], replacement, STR_WITHOUT_PRE[4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(3, replacement) | ||||
|     assert_equal [STR_WITHOUT_PRE[0..2], replacement, STR_WITHOUT_PRE[4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(5, replacement) | ||||
|     assert_equal [STR_WITHOUT_PRE[0..3], replacement].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(6, replacement) | ||||
|      | ||||
|  | ||||
|     assert_equal TEXT_WITHOUT_PRE, @formatter.new(TEXT_WITHOUT_PRE).update_section(0, replacement) | ||||
|     assert_equal TEXT_WITHOUT_PRE, @formatter.new(TEXT_WITHOUT_PRE).update_section(10, replacement) | ||||
|   end | ||||
|    | ||||
|  | ||||
|   def test_update_section_with_hash_should_update_the_requested_section | ||||
|     replacement = "New text" | ||||
|      | ||||
|  | ||||
|     assert_equal [STR_WITHOUT_PRE[0], replacement, STR_WITHOUT_PRE[2..4]].flatten.join("\n\n"), | ||||
|       @formatter.new(TEXT_WITHOUT_PRE).update_section(2, replacement, Digest::MD5.hexdigest(STR_WITHOUT_PRE[1])) | ||||
|   end | ||||
|    | ||||
|  | ||||
|   def test_update_section_with_wrong_hash_should_raise_an_error | ||||
|     assert_raise Redmine::WikiFormatting::StaleSectionError do | ||||
|       @formatter.new(TEXT_WITHOUT_PRE).update_section(2, "New text", Digest::MD5.hexdigest("Old text")) | ||||
| @@ -494,7 +494,7 @@ Nulla nunc nisi, egestas in ornare vel, posuere ac libero."] | ||||
|   def test_update_section_should_not_escape_pre_content_outside_section | ||||
|     text = STR_WITH_PRE.join("\n\n") | ||||
|     replacement = "New text" | ||||
|      | ||||
|  | ||||
|     assert_equal [STR_WITH_PRE[0..1], "New text"].flatten.join("\n\n"), | ||||
|       @formatter.new(text).update_section(3, replacement) | ||||
|   end | ||||
| @@ -509,13 +509,13 @@ Content 1 | ||||
| h1. Heading 2 | ||||
|  | ||||
| Content 2 | ||||
|   | ||||
|  | ||||
| h1. Heading 3 | ||||
|  | ||||
| Content 3 | ||||
|  | ||||
| h1. Heading 4 | ||||
|   | ||||
|  | ||||
| Content 4 | ||||
| STR | ||||
|  | ||||
| @@ -633,10 +633,10 @@ EXPECTED | ||||
|   def to_html(text) | ||||
|     @formatter.new(text).to_html | ||||
|   end | ||||
|    | ||||
|  | ||||
|   def assert_section_with_hash(expected, text, index) | ||||
|     result = @formatter.new(text).get_section(index) | ||||
|      | ||||
|  | ||||
|     assert_kind_of Array, result | ||||
|     assert_equal 2, result.size | ||||
|     assert_equal expected, result.first, "section content did not match" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user