##// END OF EJS Templates
Replaced "can't" with "cannot" in error messages....
Jean-Philippe Lang -
r13399:2a6692248b89
parent child
Show More
@@ -131,7 +131,7 class Enumeration < ActiveRecord::Base
131
131
132 private
132 private
133 def check_integrity
133 def check_integrity
134 raise "Can't delete enumeration" if self.in_use?
134 raise "Cannot delete enumeration" if self.in_use?
135 end
135 end
136
136
137 end
137 end
@@ -204,8 +204,8 private
204 end
204 end
205
205
206 def check_deletable
206 def check_deletable
207 raise "Can't delete role" if members.any?
207 raise "Cannot delete role" if members.any?
208 raise "Can't delete builtin role" if builtin?
208 raise "Cannot delete builtin role" if builtin?
209 end
209 end
210
210
211 def self.find_or_create_system_role(builtin, name)
211 def self.find_or_create_system_role(builtin, name)
@@ -109,6 +109,6 class Tracker < ActiveRecord::Base
109
109
110 private
110 private
111 def check_integrity
111 def check_integrity
112 raise Exception.new("Can't delete tracker") if Issue.where(:tracker_id => self.id).any?
112 raise Exception.new("Cannot delete tracker") if Issue.where(:tracker_id => self.id).any?
113 end
113 end
114 end
114 end
@@ -915,7 +915,7 bs:
915 error_can_not_delete_custom_field: Unable to delete custom field
915 error_can_not_delete_custom_field: Unable to delete custom field
916 error_unable_to_connect: Unable to connect (%{value})
916 error_unable_to_connect: Unable to connect (%{value})
917 error_can_not_remove_role: This role is in use and can not be deleted.
917 error_can_not_remove_role: This role is in use and can not be deleted.
918 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
918 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
919 field_principal: Principal
919 field_principal: Principal
920 label_my_page_block: My page block
920 label_my_page_block: My page block
921 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
921 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -902,7 +902,7 el:
902 error_can_not_delete_custom_field: Unable to delete custom field
902 error_can_not_delete_custom_field: Unable to delete custom field
903 error_unable_to_connect: Unable to connect (%{value})
903 error_unable_to_connect: Unable to connect (%{value})
904 error_can_not_remove_role: This role is in use and can not be deleted.
904 error_can_not_remove_role: This role is in use and can not be deleted.
905 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
905 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
906 field_principal: Principal
906 field_principal: Principal
907 label_my_page_block: My page block
907 label_my_page_block: My page block
908 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
908 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -114,8 +114,8 en-GB:
114 invalid: "is invalid"
114 invalid: "is invalid"
115 confirmation: "doesn't match confirmation"
115 confirmation: "doesn't match confirmation"
116 accepted: "must be accepted"
116 accepted: "must be accepted"
117 empty: "can't be empty"
117 empty: "cannot be empty"
118 blank: "can't be blank"
118 blank: "cannot be blank"
119 too_long: "is too long (maximum is %{count} characters)"
119 too_long: "is too long (maximum is %{count} characters)"
120 too_short: "is too short (minimum is %{count} characters)"
120 too_short: "is too short (minimum is %{count} characters)"
121 wrong_length: "is the wrong length (should be %{count} characters)"
121 wrong_length: "is the wrong length (should be %{count} characters)"
@@ -110,8 +110,8 en:
110 invalid: "is invalid"
110 invalid: "is invalid"
111 confirmation: "doesn't match confirmation"
111 confirmation: "doesn't match confirmation"
112 accepted: "must be accepted"
112 accepted: "must be accepted"
113 empty: "can't be empty"
113 empty: "cannot be empty"
114 blank: "can't be blank"
114 blank: "cannot be blank"
115 too_long: "is too long (maximum is %{count} characters)"
115 too_long: "is too long (maximum is %{count} characters)"
116 too_short: "is too short (minimum is %{count} characters)"
116 too_short: "is too short (minimum is %{count} characters)"
117 wrong_length: "is the wrong length (should be %{count} characters)"
117 wrong_length: "is the wrong length (should be %{count} characters)"
@@ -923,7 +923,7 fi:
923 error_can_not_delete_custom_field: Unable to delete custom field
923 error_can_not_delete_custom_field: Unable to delete custom field
924 error_unable_to_connect: Unable to connect (%{value})
924 error_unable_to_connect: Unable to connect (%{value})
925 error_can_not_remove_role: This role is in use and can not be deleted.
925 error_can_not_remove_role: This role is in use and can not be deleted.
926 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
926 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
927 field_principal: Principal
927 field_principal: Principal
928 label_my_page_block: My page block
928 label_my_page_block: My page block
929 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
929 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -903,7 +903,7 hr:
903 error_can_not_delete_custom_field: Unable to delete custom field
903 error_can_not_delete_custom_field: Unable to delete custom field
904 error_unable_to_connect: Unable to connect (%{value})
904 error_unable_to_connect: Unable to connect (%{value})
905 error_can_not_remove_role: This role is in use and can not be deleted.
905 error_can_not_remove_role: This role is in use and can not be deleted.
906 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
906 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
907 field_principal: Principal
907 field_principal: Principal
908 label_my_page_block: My page block
908 label_my_page_block: My page block
909 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
909 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -906,7 +906,7 id:
906 error_can_not_delete_custom_field: Unable to delete custom field
906 error_can_not_delete_custom_field: Unable to delete custom field
907 error_unable_to_connect: Unable to connect (%{value})
907 error_unable_to_connect: Unable to connect (%{value})
908 error_can_not_remove_role: This role is in use and can not be deleted.
908 error_can_not_remove_role: This role is in use and can not be deleted.
909 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
909 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
910 field_principal: Principal
910 field_principal: Principal
911 label_my_page_block: My page block
911 label_my_page_block: My page block
912 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
912 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -895,7 +895,7 lv:
895 field_parent_issue: Parent task
895 field_parent_issue: Parent task
896 error_unable_delete_issue_status: Unable to delete issue status
896 error_unable_delete_issue_status: Unable to delete issue status
897 label_subtask_plural: Apakšuzdevumi
897 label_subtask_plural: Apakšuzdevumi
898 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
898 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
899 label_project_copy_notifications: Send email notifications during the project copy
899 label_project_copy_notifications: Send email notifications during the project copy
900 field_principal: Principal
900 field_principal: Principal
901 label_my_page_block: My page block
901 label_my_page_block: My page block
@@ -182,7 +182,7 mk:
182 error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
182 error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
183 error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
183 error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
184 error_can_not_delete_custom_field: Unable to delete custom field
184 error_can_not_delete_custom_field: Unable to delete custom field
185 error_can_not_delete_tracker: "This tracker contains issues and can't be deleted."
185 error_can_not_delete_tracker: "This tracker contains issues and cannot be deleted."
186 error_can_not_remove_role: "This role is in use and can not be deleted."
186 error_can_not_remove_role: "This role is in use and can not be deleted."
187 error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version can not be reopened'
187 error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version can not be reopened'
188 error_can_not_archive_project: This project can not be archived
188 error_can_not_archive_project: This project can not be archived
@@ -903,7 +903,7 mn:
903 error_can_not_delete_custom_field: Unable to delete custom field
903 error_can_not_delete_custom_field: Unable to delete custom field
904 error_unable_to_connect: Unable to connect (%{value})
904 error_unable_to_connect: Unable to connect (%{value})
905 error_can_not_remove_role: This role is in use and can not be deleted.
905 error_can_not_remove_role: This role is in use and can not be deleted.
906 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
906 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
907 field_principal: Principal
907 field_principal: Principal
908 label_my_page_block: My page block
908 label_my_page_block: My page block
909 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
909 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -897,7 +897,7 ro:
897 error_can_not_delete_custom_field: Unable to delete custom field
897 error_can_not_delete_custom_field: Unable to delete custom field
898 error_unable_to_connect: Unable to connect (%{value})
898 error_unable_to_connect: Unable to connect (%{value})
899 error_can_not_remove_role: This role is in use and can not be deleted.
899 error_can_not_remove_role: This role is in use and can not be deleted.
900 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
900 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
901 field_principal: Principal
901 field_principal: Principal
902 label_my_page_block: My page block
902 label_my_page_block: My page block
903 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
903 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -899,7 +899,7 th:
899 error_can_not_delete_custom_field: Unable to delete custom field
899 error_can_not_delete_custom_field: Unable to delete custom field
900 error_unable_to_connect: Unable to connect (%{value})
900 error_unable_to_connect: Unable to connect (%{value})
901 error_can_not_remove_role: This role is in use and can not be deleted.
901 error_can_not_remove_role: This role is in use and can not be deleted.
902 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
902 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
903 field_principal: Principal
903 field_principal: Principal
904 label_my_page_block: My page block
904 label_my_page_block: My page block
905 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
905 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -899,7 +899,7 uk:
899 error_can_not_delete_custom_field: Unable to delete custom field
899 error_can_not_delete_custom_field: Unable to delete custom field
900 error_unable_to_connect: Unable to connect (%{value})
900 error_unable_to_connect: Unable to connect (%{value})
901 error_can_not_remove_role: This role is in use and can not be deleted.
901 error_can_not_remove_role: This role is in use and can not be deleted.
902 error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
902 error_can_not_delete_tracker: This tracker contains issues and cannot be deleted.
903 field_principal: Principal
903 field_principal: Principal
904 label_my_page_block: My page block
904 label_my_page_block: My page block
905 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
905 notice_failed_to_save_members: "Failed to save member(s): %{errors}."
@@ -382,7 +382,7 class AttachmentsControllerTest < ActionController::TestCase
382
382
383 assert_response :success
383 assert_response :success
384 assert_template 'edit'
384 assert_template 'edit'
385 assert_select_error /file #{ESCAPED_CANT} be blank/i
385 assert_select_error /file cannot be blank/i
386
386
387 # The other attachment should not be updated
387 # The other attachment should not be updated
388 attachment = Attachment.find(4)
388 attachment = Attachment.find(4)
@@ -74,7 +74,7 class AuthSourcesControllerTest < ActionController::TestCase
74 assert_response :success
74 assert_response :success
75 assert_template 'new'
75 assert_template 'new'
76 end
76 end
77 assert_select_error /host #{ESCAPED_CANT} be blank/i
77 assert_select_error /host cannot be blank/i
78 end
78 end
79
79
80 def test_edit
80 def test_edit
@@ -118,7 +118,7 class AuthSourcesControllerTest < ActionController::TestCase
118 :port => '389', :attr_login => 'uid'}
118 :port => '389', :attr_login => 'uid'}
119 assert_response :success
119 assert_response :success
120 assert_template 'edit'
120 assert_template 'edit'
121 assert_select_error /host #{ESCAPED_CANT} be blank/i
121 assert_select_error /host cannot be blank/i
122 end
122 end
123
123
124 def test_destroy
124 def test_destroy
@@ -62,7 +62,7 class IssueStatusesControllerTest < ActionController::TestCase
62 post :create, :issue_status => {:name => ''}
62 post :create, :issue_status => {:name => ''}
63 assert_response :success
63 assert_response :success
64 assert_template 'new'
64 assert_template 'new'
65 assert_select_error /name #{ESCAPED_CANT} be blank/i
65 assert_select_error /name cannot be blank/i
66 end
66 end
67
67
68 def test_edit
68 def test_edit
@@ -82,7 +82,7 class IssueStatusesControllerTest < ActionController::TestCase
82 put :update, :id => '3', :issue_status => {:name => ''}
82 put :update, :id => '3', :issue_status => {:name => ''}
83 assert_response :success
83 assert_response :success
84 assert_template 'edit'
84 assert_template 'edit'
85 assert_select_error /name #{ESCAPED_CANT} be blank/i
85 assert_select_error /name cannot be blank/i
86 end
86 end
87
87
88 def test_destroy
88 def test_destroy
@@ -1958,7 +1958,7 class IssuesControllerTest < ActionController::TestCase
1958 assert_template 'new'
1958 assert_template 'new'
1959 issue = assigns(:issue)
1959 issue = assigns(:issue)
1960 assert_not_nil issue
1960 assert_not_nil issue
1961 assert_select_error /Database #{ESCAPED_CANT} be blank/
1961 assert_select_error /Database cannot be blank/
1962 end
1962 end
1963
1963
1964 def test_create_should_validate_required_fields
1964 def test_create_should_validate_required_fields
@@ -1982,8 +1982,8 class IssuesControllerTest < ActionController::TestCase
1982 assert_template 'new'
1982 assert_template 'new'
1983 end
1983 end
1984
1984
1985 assert_select_error /Due date #{ESCAPED_CANT} be blank/i
1985 assert_select_error /Due date cannot be blank/i
1986 assert_select_error /Bar #{ESCAPED_CANT} be blank/i
1986 assert_select_error /Bar cannot be blank/i
1987 end
1987 end
1988
1988
1989 def test_create_should_ignore_readonly_fields
1989 def test_create_should_ignore_readonly_fields
@@ -3201,7 +3201,7 class IssuesControllerTest < ActionController::TestCase
3201 assert_response :success
3201 assert_response :success
3202 assert_template 'edit'
3202 assert_template 'edit'
3203
3203
3204 assert_select_error /Activity #{ESCAPED_CANT} be blank/
3204 assert_select_error /Activity cannot be blank/
3205 assert_select 'textarea[name=?]', 'issue[notes]', :text => notes
3205 assert_select 'textarea[name=?]', 'issue[notes]', :text => notes
3206 assert_select 'input[name=?][value=?]', 'time_entry[hours]', '2z'
3206 assert_select 'input[name=?][value=?]', 'time_entry[hours]', '2z'
3207 end
3207 end
@@ -3219,8 +3219,8 class IssuesControllerTest < ActionController::TestCase
3219 assert_response :success
3219 assert_response :success
3220 assert_template 'edit'
3220 assert_template 'edit'
3221
3221
3222 assert_select_error /Activity #{ESCAPED_CANT} be blank/
3222 assert_select_error /Activity cannot be blank/
3223 assert_select_error /Hours #{ESCAPED_CANT} be blank/
3223 assert_select_error /Hours cannot be blank/
3224 assert_select 'textarea[name=?]', 'issue[notes]', :text => notes
3224 assert_select 'textarea[name=?]', 'issue[notes]', :text => notes
3225 assert_select 'input[name=?][value=?]', 'time_entry[comments]', 'this is my comment'
3225 assert_select 'input[name=?][value=?]', 'time_entry[comments]', 'this is my comment'
3226 end
3226 end
@@ -129,7 +129,7 class NewsControllerTest < ActionController::TestCase
129 assert_template 'new'
129 assert_template 'new'
130 assert_not_nil assigns(:news)
130 assert_not_nil assigns(:news)
131 assert assigns(:news).new_record?
131 assert assigns(:news).new_record?
132 assert_select_error /title #{ESCAPED_CANT} be blank/i
132 assert_select_error /title cannot be blank/i
133 end
133 end
134
134
135 def test_get_edit
135 def test_get_edit
@@ -166,7 +166,7 class NewsControllerTest < ActionController::TestCase
166 put :update, :id => 1, :news => { :description => '' }
166 put :update, :id => 1, :news => { :description => '' }
167 assert_response :success
167 assert_response :success
168 assert_template 'edit'
168 assert_template 'edit'
169 assert_select_error /description #{ESCAPED_CANT} be blank/i
169 assert_select_error /description cannot be blank/i
170 end
170 end
171
171
172 def test_destroy
172 def test_destroy
@@ -104,7 +104,7 class PrincipalMembershipsControllerTest < ActionController::TestCase
104 assert_equal 'text/javascript', response.content_type
104 assert_equal 'text/javascript', response.content_type
105 end
105 end
106 assert_include 'alert', response.body, "Alert message not sent"
106 assert_include 'alert', response.body, "Alert message not sent"
107 assert_include 'Role can\\\'t be empty', response.body, "Error message not sent"
107 assert_include 'Role cannot be empty', response.body, "Error message not sent"
108 end
108 end
109
109
110 def test_update_user_membership
110 def test_update_user_membership
@@ -445,7 +445,7 class ProjectsControllerTest < ActionController::TestCase
445 post :update, :id => 1, :project => {:name => ''}
445 post :update, :id => 1, :project => {:name => ''}
446 assert_response :success
446 assert_response :success
447 assert_template 'settings'
447 assert_template 'settings'
448 assert_select_error /name #{ESCAPED_CANT} be blank/i
448 assert_select_error /name cannot be blank/i
449 end
449 end
450
450
451 def test_update_should_be_denied_for_member_on_closed_project
451 def test_update_should_be_denied_for_member_on_closed_project
@@ -89,7 +89,7 class TrackersControllerTest < ActionController::TestCase
89 end
89 end
90 assert_response :success
90 assert_response :success
91 assert_template 'new'
91 assert_template 'new'
92 assert_select_error /name #{ESCAPED_CANT} be blank/i
92 assert_select_error /name cannot be blank/i
93 end
93 end
94
94
95 def test_edit
95 def test_edit
@@ -147,7 +147,7 class TrackersControllerTest < ActionController::TestCase
147 put :update, :id => 1, :tracker => { :name => '' }
147 put :update, :id => 1, :tracker => { :name => '' }
148 assert_response :success
148 assert_response :success
149 assert_template 'edit'
149 assert_template 'edit'
150 assert_select_error /name #{ESCAPED_CANT} be blank/i
150 assert_select_error /name cannot be blank/i
151 end
151 end
152
152
153 def test_move_lower
153 def test_move_lower
@@ -928,7 +928,7 class WikiControllerTest < ActionController::TestCase
928 end
928 end
929
929
930 def test_edit_protected_page_by_nonmember
930 def test_edit_protected_page_by_nonmember
931 # Non members can't edit protected wiki pages
931 # Non members cannot edit protected wiki pages
932 @request.session[:user_id] = 4
932 @request.session[:user_id] = 4
933 get :edit, :project_id => 1, :id => 'CookBook_documentation'
933 get :edit, :project_id => 1, :id => 'CookBook_documentation'
934 assert_response 403
934 assert_response 403
@@ -51,7 +51,7 class WikisControllerTest < ActionController::TestCase
51 end
51 end
52
52
53 assert_include 'errorExplanation', response.body
53 assert_include 'errorExplanation', response.body
54 assert_include "Start page #{ESCAPED_CANT} be blank", response.body
54 assert_include "Start page cannot be blank", response.body
55 end
55 end
56
56
57 def test_update
57 def test_update
@@ -144,7 +144,7 class Redmine::ApiTest::GroupsTest < Redmine::ApiTest::Base
144 assert_equal 'application/xml', response.content_type
144 assert_equal 'application/xml', response.content_type
145
145
146 assert_select 'errors' do
146 assert_select 'errors' do
147 assert_select 'error', :text => /Name can't be blank/
147 assert_select 'error', :text => /Name cannot be blank/
148 end
148 end
149 end
149 end
150
150
@@ -164,7 +164,7 class Redmine::ApiTest::GroupsTest < Redmine::ApiTest::Base
164 assert_equal 'application/xml', response.content_type
164 assert_equal 'application/xml', response.content_type
165
165
166 assert_select 'errors' do
166 assert_select 'errors' do
167 assert_select 'error', :text => /Name can't be blank/
167 assert_select 'error', :text => /Name cannot be blank/
168 end
168 end
169 end
169 end
170
170
@@ -57,7 +57,7 class Redmine::ApiTest::IssueCategoriesTest < Redmine::ApiTest::Base
57 assert_response :unprocessable_entity
57 assert_response :unprocessable_entity
58 assert_equal 'application/xml', @response.content_type
58 assert_equal 'application/xml', @response.content_type
59
59
60 assert_select 'errors error', :text => "Name can't be blank"
60 assert_select 'errors error', :text => "Name cannot be blank"
61 end
61 end
62
62
63 test "PUT /issue_categories/:id.xml with valid parameters should update the issue category" do
63 test "PUT /issue_categories/:id.xml with valid parameters should update the issue category" do
@@ -76,7 +76,7 class Redmine::ApiTest::IssueCategoriesTest < Redmine::ApiTest::Base
76 assert_response :unprocessable_entity
76 assert_response :unprocessable_entity
77 assert_equal 'application/xml', @response.content_type
77 assert_equal 'application/xml', @response.content_type
78
78
79 assert_select 'errors error', :text => "Name can't be blank"
79 assert_select 'errors error', :text => "Name cannot be blank"
80 end
80 end
81
81
82 test "DELETE /issue_categories/:id.xml should destroy the issue category" do
82 test "DELETE /issue_categories/:id.xml should destroy the issue category" do
@@ -90,7 +90,7 class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
90
90
91 assert_response :unprocessable_entity
91 assert_response :unprocessable_entity
92 assert_equal 'application/xml', @response.content_type
92 assert_equal 'application/xml', @response.content_type
93 assert_select 'errors error', :text => "Start date can't be blank"
93 assert_select 'errors error', :text => "Start date cannot be blank"
94 end
94 end
95
95
96 test "GET /issues.xml with custom field filter" do
96 test "GET /issues.xml with custom field filter" do
@@ -361,7 +361,7 class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
361 post '/issues.xml', {:issue => {:project_id => 1}}, credentials('jsmith')
361 post '/issues.xml', {:issue => {:project_id => 1}}, credentials('jsmith')
362 end
362 end
363
363
364 assert_select 'errors error', :text => "Subject can't be blank"
364 assert_select 'errors error', :text => "Subject cannot be blank"
365 end
365 end
366
366
367 test "POST /issues.json should create an issue with the attributes" do
367 test "POST /issues.json should create an issue with the attributes" do
@@ -385,7 +385,7 class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
385 end
385 end
386
386
387 json = ActiveSupport::JSON.decode(response.body)
387 json = ActiveSupport::JSON.decode(response.body)
388 assert json['errors'].include?("Subject can't be blank")
388 assert json['errors'].include?("Subject cannot be blank")
389 end
389 end
390
390
391 test "PUT /issues/:id.xml" do
391 test "PUT /issues/:id.xml" do
@@ -444,7 +444,7 class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
444 put '/issues/6.xml', {:issue => {:subject => ''}}, credentials('jsmith')
444 put '/issues/6.xml', {:issue => {:subject => ''}}, credentials('jsmith')
445
445
446 assert_response :unprocessable_entity
446 assert_response :unprocessable_entity
447 assert_select 'errors error', :text => "Subject can't be blank"
447 assert_select 'errors error', :text => "Subject cannot be blank"
448 end
448 end
449
449
450 test "PUT /issues/:id.json" do
450 test "PUT /issues/:id.json" do
@@ -468,7 +468,7 class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
468
468
469 assert_response :unprocessable_entity
469 assert_response :unprocessable_entity
470 json = ActiveSupport::JSON.decode(response.body)
470 json = ActiveSupport::JSON.decode(response.body)
471 assert json['errors'].include?("Subject can't be blank")
471 assert json['errors'].include?("Subject cannot be blank")
472 end
472 end
473
473
474 test "DELETE /issues/:id.xml" do
474 test "DELETE /issues/:id.xml" do
@@ -85,7 +85,7 class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base
85
85
86 assert_response :unprocessable_entity
86 assert_response :unprocessable_entity
87 assert_equal 'application/xml', @response.content_type
87 assert_equal 'application/xml', @response.content_type
88 assert_select 'errors error', :text => "Principal can't be blank"
88 assert_select 'errors error', :text => "Principal cannot be blank"
89 end
89 end
90 end
90 end
91
91
@@ -133,7 +133,7 class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base
133
133
134 assert_response :unprocessable_entity
134 assert_response :unprocessable_entity
135 assert_equal 'application/xml', @response.content_type
135 assert_equal 'application/xml', @response.content_type
136 assert_select 'errors error', :text => "Role can't be empty"
136 assert_select 'errors error', :text => "Role cannot be empty"
137 end
137 end
138
138
139 test "DELETE /memberships/:id.xml should destroy the membership" do
139 test "DELETE /memberships/:id.xml should destroy the membership" do
@@ -148,7 +148,7 class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base
148
148
149 test "DELETE /memberships/:id.xml should respond with 422 on failure" do
149 test "DELETE /memberships/:id.xml should respond with 422 on failure" do
150 assert_no_difference 'Member.count' do
150 assert_no_difference 'Member.count' do
151 # A membership with an inherited role can't be deleted
151 # A membership with an inherited role cannot be deleted
152 Member.find(2).member_roles.first.update_attribute :inherited_from, 99
152 Member.find(2).member_roles.first.update_attribute :inherited_from, 99
153 delete '/memberships/2.xml', {}, credentials('jsmith')
153 delete '/memberships/2.xml', {}, credentials('jsmith')
154
154
@@ -179,7 +179,7 class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
179
179
180 assert_response :unprocessable_entity
180 assert_response :unprocessable_entity
181 assert_equal 'application/xml', @response.content_type
181 assert_equal 'application/xml', @response.content_type
182 assert_select 'errors error', :text => "Identifier can't be blank"
182 assert_select 'errors error', :text => "Identifier cannot be blank"
183 end
183 end
184
184
185 test "PUT /projects/:id.xml with valid parameters should update the project" do
185 test "PUT /projects/:id.xml with valid parameters should update the project" do
@@ -220,7 +220,7 class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
220
220
221 assert_response :unprocessable_entity
221 assert_response :unprocessable_entity
222 assert_equal 'application/xml', @response.content_type
222 assert_equal 'application/xml', @response.content_type
223 assert_select 'errors error', :text => "Name can't be blank"
223 assert_select 'errors error', :text => "Name cannot be blank"
224 end
224 end
225
225
226 test "DELETE /projects/:id.xml should delete the project" do
226 test "DELETE /projects/:id.xml should delete the project" do
@@ -102,7 +102,7 class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
102 assert_response :unprocessable_entity
102 assert_response :unprocessable_entity
103 assert_equal 'application/xml', @response.content_type
103 assert_equal 'application/xml', @response.content_type
104
104
105 assert_select 'errors error', :text => "Hours can't be blank"
105 assert_select 'errors error', :text => "Hours cannot be blank"
106 end
106 end
107
107
108 test "PUT /time_entries/:id.xml with valid parameters should update time entry" do
108 test "PUT /time_entries/:id.xml with valid parameters should update time entry" do
@@ -121,7 +121,7 class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
121 assert_response :unprocessable_entity
121 assert_response :unprocessable_entity
122 assert_equal 'application/xml', @response.content_type
122 assert_equal 'application/xml', @response.content_type
123
123
124 assert_select 'errors error', :text => "Hours can't be blank"
124 assert_select 'errors error', :text => "Hours cannot be blank"
125 end
125 end
126
126
127 test "DELETE /time_entries/:id.xml should destroy time entry" do
127 test "DELETE /time_entries/:id.xml should destroy time entry" do
@@ -183,7 +183,7 class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
183
183
184 assert_response :unprocessable_entity
184 assert_response :unprocessable_entity
185 assert_equal 'application/xml', @response.content_type
185 assert_equal 'application/xml', @response.content_type
186 assert_select 'errors error', :text => "First name can't be blank"
186 assert_select 'errors error', :text => "First name cannot be blank"
187 end
187 end
188
188
189 test "POST /users.json with with invalid parameters should return errors" do
189 test "POST /users.json with with invalid parameters should return errors" do
@@ -253,7 +253,7 class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
253
253
254 assert_response :unprocessable_entity
254 assert_response :unprocessable_entity
255 assert_equal 'application/xml', @response.content_type
255 assert_equal 'application/xml', @response.content_type
256 assert_select 'errors error', :text => "First name can't be blank"
256 assert_select 'errors error', :text => "First name cannot be blank"
257 end
257 end
258
258
259 test "PUT /users/:id.json with invalid parameters" do
259 test "PUT /users/:id.json with invalid parameters" do
@@ -94,7 +94,7 class Redmine::ApiTest::VersionsTest < Redmine::ApiTest::Base
94 end
94 end
95
95
96 assert_response :unprocessable_entity
96 assert_response :unprocessable_entity
97 assert_select 'errors error', :text => "Name can't be blank"
97 assert_select 'errors error', :text => "Name cannot be blank"
98 end
98 end
99
99
100 test "GET /versions/:id.xml should return the version" do
100 test "GET /versions/:id.xml should return the version" do
@@ -44,12 +44,6 class ActiveSupport::TestCase
44 self.use_transactional_fixtures = true
44 self.use_transactional_fixtures = true
45 self.use_instantiated_fixtures = false
45 self.use_instantiated_fixtures = false
46
46
47 #ESCAPED_CANT = 'can&#x27;t'
48 #ESCAPED_UCANT = 'Can&#x27;t'
49 # Rails 4.0.2
50 ESCAPED_CANT = 'can&#39;t'
51 ESCAPED_UCANT = 'Can&#39;t'
52
53 def uploaded_test_file(name, mime)
47 def uploaded_test_file(name, mime)
54 fixture_file_upload("files/#{name}", mime, true)
48 fixture_file_upload("files/#{name}", mime, true)
55 end
49 end
@@ -47,7 +47,7 class GroupTest < ActiveSupport::TestCase
47 set_language_if_valid 'en'
47 set_language_if_valid 'en'
48 g = Group.new
48 g = Group.new
49 assert !g.save
49 assert !g.save
50 assert_include "Name can't be blank", g.errors.full_messages
50 assert_include "Name cannot be blank", g.errors.full_messages
51 end
51 end
52
52
53 def test_blank_name_error_message_fr
53 def test_blank_name_error_message_fr
@@ -26,7 +26,7 class IssueCustomFieldTest < ActiveSupport::TestCase
26 set_language_if_valid 'en'
26 set_language_if_valid 'en'
27 field = IssueCustomField.new(:name => 'Field', :field_format => 'string', :visible => false)
27 field = IssueCustomField.new(:name => 'Field', :field_format => 'string', :visible => false)
28 assert !field.save
28 assert !field.save
29 assert_include "Roles can't be blank", field.errors.full_messages
29 assert_include "Roles cannot be blank", field.errors.full_messages
30 field.role_ids = [1, 2]
30 field.role_ids = [1, 2]
31 assert field.save
31 assert field.save
32 end
32 end
@@ -50,7 +50,7 class IssueStatusTest < ActiveSupport::TestCase
50 def test_destroy_status_in_use
50 def test_destroy_status_in_use
51 # Status assigned to an Issue
51 # Status assigned to an Issue
52 status = Issue.find(1).status
52 status = Issue.find(1).status
53 assert_raise(RuntimeError, "Can't delete status") { status.destroy }
53 assert_raise(RuntimeError, "Cannot delete status") { status.destroy }
54 end
54 end
55
55
56 def test_new_statuses_allowed_to
56 def test_new_statuses_allowed_to
@@ -136,11 +136,11 class IssueTest < ActiveSupport::TestCase
136 assert issue.available_custom_fields.include?(field)
136 assert issue.available_custom_fields.include?(field)
137 # No value for the custom field
137 # No value for the custom field
138 assert !issue.save
138 assert !issue.save
139 assert_equal ["Database can't be blank"], issue.errors.full_messages
139 assert_equal ["Database cannot be blank"], issue.errors.full_messages
140 # Blank value
140 # Blank value
141 issue.custom_field_values = { field.id => '' }
141 issue.custom_field_values = { field.id => '' }
142 assert !issue.save
142 assert !issue.save
143 assert_equal ["Database can't be blank"], issue.errors.full_messages
143 assert_equal ["Database cannot be blank"], issue.errors.full_messages
144 # Invalid value
144 # Invalid value
145 issue.custom_field_values = { field.id => 'SQLServer' }
145 issue.custom_field_values = { field.id => 'SQLServer' }
146 assert !issue.save
146 assert !issue.save
@@ -826,13 +826,13 class IssueTest < ActiveSupport::TestCase
826 assert_equal [cf.id.to_s, "category_id", "due_date"],
826 assert_equal [cf.id.to_s, "category_id", "due_date"],
827 issue.required_attribute_names(user).sort
827 issue.required_attribute_names(user).sort
828 assert !issue.save, "Issue was saved"
828 assert !issue.save, "Issue was saved"
829 assert_equal ["Category can't be blank", "Due date can't be blank", "Foo can't be blank"],
829 assert_equal ["Category cannot be blank", "Due date cannot be blank", "Foo cannot be blank"],
830 issue.errors.full_messages.sort
830 issue.errors.full_messages.sort
831
831
832 issue.tracker_id = 2
832 issue.tracker_id = 2
833 assert_equal [cf.id.to_s, "start_date"], issue.required_attribute_names(user).sort
833 assert_equal [cf.id.to_s, "start_date"], issue.required_attribute_names(user).sort
834 assert !issue.save, "Issue was saved"
834 assert !issue.save, "Issue was saved"
835 assert_equal ["Foo can't be blank", "Start date can't be blank"],
835 assert_equal ["Foo cannot be blank", "Start date cannot be blank"],
836 issue.errors.full_messages.sort
836 issue.errors.full_messages.sort
837
837
838 issue.start_date = Date.today
838 issue.start_date = Date.today
@@ -850,7 +850,7 class IssueTest < ActiveSupport::TestCase
850 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1,
850 issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1,
851 :subject => 'Required fields', :author => user)
851 :subject => 'Required fields', :author => user)
852 assert !issue.save
852 assert !issue.save
853 assert_include "Start date can't be blank", issue.errors.full_messages
853 assert_include "Start date cannot be blank", issue.errors.full_messages
854
854
855 tracker = Tracker.find(1)
855 tracker = Tracker.find(1)
856 tracker.core_fields -= %w(start_date)
856 tracker.core_fields -= %w(start_date)
@@ -65,7 +65,7 class MemberTest < ActiveSupport::TestCase
65
65
66 def test_validate
66 def test_validate
67 member = Member.new(:project_id => 1, :user_id => 2, :role_ids => [2])
67 member = Member.new(:project_id => 1, :user_id => 2, :role_ids => [2])
68 # same use can't have more than one membership for a project
68 # same use cannot have more than one membership for a project
69 assert !member.save
69 assert !member.save
70
70
71 # must have one role at least
71 # must have one role at least
@@ -37,7 +37,7 class QueryTest < ActiveSupport::TestCase
37 set_language_if_valid 'en'
37 set_language_if_valid 'en'
38 query = IssueQuery.new(:name => 'Query', :visibility => IssueQuery::VISIBILITY_ROLES)
38 query = IssueQuery.new(:name => 'Query', :visibility => IssueQuery::VISIBILITY_ROLES)
39 assert !query.save
39 assert !query.save
40 assert_include "Roles can't be blank", query.errors.full_messages
40 assert_include "Roles cannot be blank", query.errors.full_messages
41 query.role_ids = [1, 2]
41 query.role_ids = [1, 2]
42 assert query.save
42 assert query.save
43 end
43 end
@@ -63,7 +63,7 class RepositoryBazaarTest < ActiveSupport::TestCase
63 :log_encoding => 'UTF-8'
63 :log_encoding => 'UTF-8'
64 )
64 )
65 assert !repo.save
65 assert !repo.save
66 assert_include "Path to repository can't be blank",
66 assert_include "Path to repository cannot be blank",
67 repo.errors.full_messages
67 repo.errors.full_messages
68 end
68 end
69
69
@@ -46,7 +46,7 class RepositoryCvsTest < ActiveSupport::TestCase
46 :root_url => REPOSITORY_PATH
46 :root_url => REPOSITORY_PATH
47 )
47 )
48 assert !repo.save
48 assert !repo.save
49 assert_include "Module can't be blank",
49 assert_include "Module cannot be blank",
50 repo.errors.full_messages
50 repo.errors.full_messages
51 end
51 end
52
52
@@ -74,7 +74,7 class RepositoryCvsTest < ActiveSupport::TestCase
74 :url => MODULE_NAME
74 :url => MODULE_NAME
75 )
75 )
76 assert !repo.save
76 assert !repo.save
77 assert_include "CVSROOT can't be blank",
77 assert_include "CVSROOT cannot be blank",
78 repo.errors.full_messages
78 repo.errors.full_messages
79 end
79 end
80
80
@@ -43,7 +43,7 class RepositoryDarcsTest < ActiveSupport::TestCase
43 :log_encoding => 'UTF-8'
43 :log_encoding => 'UTF-8'
44 )
44 )
45 assert !repo.save
45 assert !repo.save
46 assert_include "Path to repository can't be blank",
46 assert_include "Path to repository cannot be blank",
47 repo.errors.full_messages
47 repo.errors.full_messages
48 end
48 end
49
49
@@ -41,7 +41,7 class RepositoryFilesystemTest < ActiveSupport::TestCase
41 :identifier => 'test'
41 :identifier => 'test'
42 )
42 )
43 assert !repo.save
43 assert !repo.save
44 assert_include "Root directory can't be blank",
44 assert_include "Root directory cannot be blank",
45 repo.errors.full_messages
45 repo.errors.full_messages
46 end
46 end
47
47
@@ -56,7 +56,7 class RepositoryGitTest < ActiveSupport::TestCase
56 :identifier => 'test'
56 :identifier => 'test'
57 )
57 )
58 assert !repo.save
58 assert !repo.save
59 assert_include "Path to repository can't be blank",
59 assert_include "Path to repository cannot be blank",
60 repo.errors.full_messages
60 repo.errors.full_messages
61 end
61 end
62
62
@@ -45,7 +45,7 class RepositoryMercurialTest < ActiveSupport::TestCase
45 :identifier => 'test'
45 :identifier => 'test'
46 )
46 )
47 assert !repo.save
47 assert !repo.save
48 assert_include "Path to repository can't be blank",
48 assert_include "Path to repository cannot be blank",
49 repo.errors.full_messages
49 repo.errors.full_messages
50 end
50 end
51
51
@@ -48,7 +48,7 class RepositoryTest < ActiveSupport::TestCase
48 :log_encoding => ''
48 :log_encoding => ''
49 )
49 )
50 assert !repo.save
50 assert !repo.save
51 assert_include "Commit messages encoding can't be blank",
51 assert_include "Commit messages encoding cannot be blank",
52 repo.errors.full_messages
52 repo.errors.full_messages
53 end
53 end
54
54
@@ -59,7 +59,7 class TimeEntryActivityTest < ActiveSupport::TestCase
59
59
60 e = TimeEntryActivity.new(:name => 'Custom Data')
60 e = TimeEntryActivity.new(:name => 'Custom Data')
61 assert !e.save
61 assert !e.save
62 assert_equal ["Billable can't be blank"], e.errors.full_messages
62 assert_equal ["Billable cannot be blank"], e.errors.full_messages
63 end
63 end
64
64
65 def test_create_with_required_custom_field_should_succeed
65 def test_create_with_required_custom_field_should_succeed
@@ -83,7 +83,7 class TimeEntryActivityTest < ActiveSupport::TestCase
83 # Blanking custom field, save should fail
83 # Blanking custom field, save should fail
84 e.custom_field_values = {field.id => ""}
84 e.custom_field_values = {field.id => ""}
85 assert !e.save
85 assert !e.save
86 assert_equal ["Billable can't be blank"], e.errors.full_messages
86 assert_equal ["Billable cannot be blank"], e.errors.full_messages
87
87
88 # Update custom field to valid value, save should succeed
88 # Update custom field to valid value, save should succeed
89 e.custom_field_values = {field.id => "0"}
89 e.custom_field_values = {field.id => "0"}
General Comments 0
You need to be logged in to leave comments. Login now