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