@@ -75,7 +75,7 class ActivitiesControllerTest < ActionController::TestCase | |||||
75 | assert_template 'index' |
|
75 | assert_template 'index' | |
76 | assert_not_nil assigns(:events_by_day) |
|
76 | assert_not_nil assigns(:events_by_day) | |
77 |
|
77 | |||
78 | assert_select 'h2 a[href=/users/2]', :text => 'John Smith' |
|
78 | assert_select 'h2 a[href="/users/2"]', :text => 'John Smith' | |
79 |
|
79 | |||
80 | i1 = Issue.find(1) |
|
80 | i1 = Issue.find(1) | |
81 | d1 = User.find(1).time_to_date(i1.created_on) |
|
81 | d1 = User.find(1).time_to_date(i1.created_on) |
@@ -129,7 +129,7 class AdminControllerTest < ActionController::TestCase | |||||
129 |
|
129 | |||
130 | assert_select 'tr#plugin-foo' do |
|
130 | assert_select 'tr#plugin-foo' do | |
131 | assert_select 'td span.name', :text => 'Foo plugin' |
|
131 | assert_select 'td span.name', :text => 'Foo plugin' | |
132 | assert_select 'td.configure a[href=/settings/plugin/foo]' |
|
132 | assert_select 'td.configure a[href="/settings/plugin/foo"]' | |
133 | end |
|
133 | end | |
134 | assert_select 'tr#plugin-bar' do |
|
134 | assert_select 'tr#plugin-bar' do | |
135 | assert_select 'td span.name', :text => 'Bar' |
|
135 | assert_select 'td span.name', :text => 'Bar' | |
@@ -150,7 +150,7 class AdminControllerTest < ActionController::TestCase | |||||
150 |
|
150 | |||
151 | get :index |
|
151 | get :index | |
152 | assert_response :success |
|
152 | assert_response :success | |
153 | assert_select 'div#admin-menu a[href=/foo/bar]', :text => 'Test' |
|
153 | assert_select 'div#admin-menu a[href="/foo/bar"]', :text => 'Test' | |
154 |
|
154 | |||
155 | Redmine::MenuManager.map :admin_menu do |menu| |
|
155 | Redmine::MenuManager.map :admin_menu do |menu| | |
156 | menu.delete :test_admin_menu_plugin_extension |
|
156 | menu.delete :test_admin_menu_plugin_extension |
@@ -117,8 +117,8 class BoardsControllerTest < ActionController::TestCase | |||||
117 |
|
117 | |||
118 | assert_select 'select[name=?]', 'board[parent_id]' do |
|
118 | assert_select 'select[name=?]', 'board[parent_id]' do | |
119 | assert_select 'option', (Project.find(1).boards.size + 1) |
|
119 | assert_select 'option', (Project.find(1).boards.size + 1) | |
120 | assert_select 'option[value=]', :text => ' ' |
|
120 | assert_select 'option[value=""]', :text => ' ' | |
121 | assert_select 'option[value=1]', :text => 'Help' |
|
121 | assert_select 'option[value="1"]', :text => 'Help' | |
122 | end |
|
122 | end | |
123 | end |
|
123 | end | |
124 |
|
124 | |||
@@ -178,7 +178,7 class BoardsControllerTest < ActionController::TestCase | |||||
178 | assert_template 'edit' |
|
178 | assert_template 'edit' | |
179 |
|
179 | |||
180 | assert_select 'select[name=?]', 'board[parent_id]' do |
|
180 | assert_select 'select[name=?]', 'board[parent_id]' do | |
181 | assert_select 'option[value=2][selected=selected]' |
|
181 | assert_select 'option[value="2"][selected=selected]' | |
182 | end |
|
182 | end | |
183 | end |
|
183 | end | |
184 |
|
184 |
@@ -112,7 +112,7 class EnumerationsControllerTest < ActionController::TestCase | |||||
112 | assert_template 'destroy' |
|
112 | assert_template 'destroy' | |
113 | assert_not_nil Enumeration.find_by_id(4) |
|
113 | assert_not_nil Enumeration.find_by_id(4) | |
114 | assert_select 'select[name=reassign_to_id]' do |
|
114 | assert_select 'select[name=reassign_to_id]' do | |
115 | assert_select 'option[value=6]', :text => 'High' |
|
115 | assert_select 'option[value="6"]', :text => 'High' | |
116 | end |
|
116 | end | |
117 | end |
|
117 | end | |
118 |
|
118 |
@@ -60,11 +60,11 class IssuesControllerTest < ActionController::TestCase | |||||
60 | assert_nil assigns(:project) |
|
60 | assert_nil assigns(:project) | |
61 |
|
61 | |||
62 | # links to visible issues |
|
62 | # links to visible issues | |
63 | assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/ |
|
63 | assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/ | |
64 | assert_select 'a[href=/issues/5]', :text => /Subproject issue/ |
|
64 | assert_select 'a[href="/issues/5"]', :text => /Subproject issue/ | |
65 | # private projects hidden |
|
65 | # private projects hidden | |
66 | assert_select 'a[href=/issues/6]', 0 |
|
66 | assert_select 'a[href="/issues/6"]', 0 | |
67 | assert_select 'a[href=/issues/4]', 0 |
|
67 | assert_select 'a[href="/issues/4"]', 0 | |
68 | # project column |
|
68 | # project column | |
69 | assert_select 'th', :text => /Project/ |
|
69 | assert_select 'th', :text => /Project/ | |
70 | end |
|
70 | end | |
@@ -78,8 +78,8 class IssuesControllerTest < ActionController::TestCase | |||||
78 | assert_not_nil assigns(:issues) |
|
78 | assert_not_nil assigns(:issues) | |
79 | assert_nil assigns(:project) |
|
79 | assert_nil assigns(:project) | |
80 |
|
80 | |||
81 | assert_select 'a[href=/issues/1]', 0 |
|
81 | assert_select 'a[href="/issues/1"]', 0 | |
82 | assert_select 'a[href=/issues/5]', :text => /Subproject issue/ |
|
82 | assert_select 'a[href="/issues/5"]', :text => /Subproject issue/ | |
83 | end |
|
83 | end | |
84 |
|
84 | |||
85 | def test_index_should_list_visible_issues_only |
|
85 | def test_index_should_list_visible_issues_only | |
@@ -96,8 +96,8 class IssuesControllerTest < ActionController::TestCase | |||||
96 | assert_template 'index' |
|
96 | assert_template 'index' | |
97 | assert_not_nil assigns(:issues) |
|
97 | assert_not_nil assigns(:issues) | |
98 |
|
98 | |||
99 | assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/ |
|
99 | assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/ | |
100 | assert_select 'a[href=/issues/5]', 0 |
|
100 | assert_select 'a[href="/issues/5"]', 0 | |
101 | end |
|
101 | end | |
102 |
|
102 | |||
103 | def test_index_with_project_and_subprojects |
|
103 | def test_index_with_project_and_subprojects | |
@@ -107,9 +107,9 class IssuesControllerTest < ActionController::TestCase | |||||
107 | assert_template 'index' |
|
107 | assert_template 'index' | |
108 | assert_not_nil assigns(:issues) |
|
108 | assert_not_nil assigns(:issues) | |
109 |
|
109 | |||
110 | assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/ |
|
110 | assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/ | |
111 | assert_select 'a[href=/issues/5]', :text => /Subproject issue/ |
|
111 | assert_select 'a[href="/issues/5"]', :text => /Subproject issue/ | |
112 | assert_select 'a[href=/issues/6]', 0 |
|
112 | assert_select 'a[href="/issues/6"]', 0 | |
113 | end |
|
113 | end | |
114 |
|
114 | |||
115 | def test_index_with_project_and_subprojects_should_show_private_subprojects_with_permission |
|
115 | def test_index_with_project_and_subprojects_should_show_private_subprojects_with_permission | |
@@ -120,9 +120,9 class IssuesControllerTest < ActionController::TestCase | |||||
120 | assert_template 'index' |
|
120 | assert_template 'index' | |
121 | assert_not_nil assigns(:issues) |
|
121 | assert_not_nil assigns(:issues) | |
122 |
|
122 | |||
123 | assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/ |
|
123 | assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/ | |
124 | assert_select 'a[href=/issues/5]', :text => /Subproject issue/ |
|
124 | assert_select 'a[href="/issues/5"]', :text => /Subproject issue/ | |
125 | assert_select 'a[href=/issues/6]', :text => /Issue of a private subproject/ |
|
125 | assert_select 'a[href="/issues/6"]', :text => /Issue of a private subproject/ | |
126 | end |
|
126 | end | |
127 |
|
127 | |||
128 | def test_index_with_project_and_default_filter |
|
128 | def test_index_with_project_and_default_filter | |
@@ -368,9 +368,9 class IssuesControllerTest < ActionController::TestCase | |||||
368 | def test_index_should_omit_page_param_in_export_links |
|
368 | def test_index_should_omit_page_param_in_export_links | |
369 | get :index, :page => 2 |
|
369 | get :index, :page => 2 | |
370 | assert_response :success |
|
370 | assert_response :success | |
371 | assert_select 'a.atom[href=/issues.atom]' |
|
371 | assert_select 'a.atom[href="/issues.atom"]' | |
372 | assert_select 'a.csv[href=/issues.csv]' |
|
372 | assert_select 'a.csv[href="/issues.csv"]' | |
373 | assert_select 'a.pdf[href=/issues.pdf]' |
|
373 | assert_select 'a.pdf[href="/issues.pdf"]' | |
374 | assert_select 'form#csv-export-form[action=/issues.csv]' |
|
374 | assert_select 'form#csv-export-form[action=/issues.csv]' | |
375 | end |
|
375 | end | |
376 |
|
376 | |||
@@ -1026,8 +1026,8 class IssuesControllerTest < ActionController::TestCase | |||||
1026 |
|
1026 | |||
1027 | assert_select 'form#issue-form' do |
|
1027 | assert_select 'form#issue-form' do | |
1028 | assert_select 'select[name=?]', 'issue[priority_id]' do |
|
1028 | assert_select 'select[name=?]', 'issue[priority_id]' do | |
1029 | assert_select 'option[value=4]' |
|
1029 | assert_select 'option[value="4"]' | |
1030 | assert_select 'option[value=15]', 0 |
|
1030 | assert_select 'option[value="15"]', 0 | |
1031 | end |
|
1031 | end | |
1032 | end |
|
1032 | end | |
1033 | end |
|
1033 | end | |
@@ -1137,7 +1137,7 class IssuesControllerTest < ActionController::TestCase | |||||
1137 |
|
1137 | |||
1138 | assert_select 'div.subject' do |
|
1138 | assert_select 'div.subject' do | |
1139 | assert_select 'h3', 'Child Issue' |
|
1139 | assert_select 'h3', 'Child Issue' | |
1140 | assert_select 'a[href=/issues/1]' |
|
1140 | assert_select 'a[href="/issues/1"]' | |
1141 | end |
|
1141 | end | |
1142 | end |
|
1142 | end | |
1143 |
|
1143 | |||
@@ -1166,8 +1166,8 class IssuesControllerTest < ActionController::TestCase | |||||
1166 | count = Issue.open.visible.count |
|
1166 | count = Issue.open.visible.count | |
1167 |
|
1167 | |||
1168 | assert_select 'div.next-prev-links' do |
|
1168 | assert_select 'div.next-prev-links' do | |
1169 | assert_select 'a[href=/issues/2]', :text => /Previous/ |
|
1169 | assert_select 'a[href="/issues/2"]', :text => /Previous/ | |
1170 | assert_select 'a[href=/issues/5]', :text => /Next/ |
|
1170 | assert_select 'a[href="/issues/5"]', :text => /Next/ | |
1171 | assert_select 'span.position', :text => "3 of #{count}" |
|
1171 | assert_select 'span.position', :text => "3 of #{count}" | |
1172 | end |
|
1172 | end | |
1173 | end |
|
1173 | end | |
@@ -1187,8 +1187,8 class IssuesControllerTest < ActionController::TestCase | |||||
1187 | assert_equal 12, assigns(:next_issue_id) |
|
1187 | assert_equal 12, assigns(:next_issue_id) | |
1188 |
|
1188 | |||
1189 | assert_select 'div.next-prev-links' do |
|
1189 | assert_select 'div.next-prev-links' do | |
1190 | assert_select 'a[href=/issues/8]', :text => /Previous/ |
|
1190 | assert_select 'a[href="/issues/8"]', :text => /Previous/ | |
1191 | assert_select 'a[href=/issues/12]', :text => /Next/ |
|
1191 | assert_select 'a[href="/issues/12"]', :text => /Next/ | |
1192 | end |
|
1192 | end | |
1193 | end |
|
1193 | end | |
1194 |
|
1194 | |||
@@ -1221,8 +1221,8 class IssuesControllerTest < ActionController::TestCase | |||||
1221 | assert_equal 7, assigns(:next_issue_id) |
|
1221 | assert_equal 7, assigns(:next_issue_id) | |
1222 |
|
1222 | |||
1223 | assert_select 'div.next-prev-links' do |
|
1223 | assert_select 'div.next-prev-links' do | |
1224 | assert_select 'a[href=/issues/2]', :text => /Previous/ |
|
1224 | assert_select 'a[href="/issues/2"]', :text => /Previous/ | |
1225 | assert_select 'a[href=/issues/7]', :text => /Next/ |
|
1225 | assert_select 'a[href="/issues/7"]', :text => /Next/ | |
1226 | end |
|
1226 | end | |
1227 | end |
|
1227 | end | |
1228 |
|
1228 | |||
@@ -1240,7 +1240,7 class IssuesControllerTest < ActionController::TestCase | |||||
1240 |
|
1240 | |||
1241 | assert_select 'div.next-prev-links' do |
|
1241 | assert_select 'div.next-prev-links' do | |
1242 | assert_select 'a', :text => /Previous/, :count => 0 |
|
1242 | assert_select 'a', :text => /Previous/, :count => 0 | |
1243 | assert_select 'a[href=/issues/2]', :text => /Next/ |
|
1243 | assert_select 'a[href="/issues/2"]', :text => /Next/ | |
1244 | end |
|
1244 | end | |
1245 | end |
|
1245 | end | |
1246 |
|
1246 | |||
@@ -1276,8 +1276,8 class IssuesControllerTest < ActionController::TestCase | |||||
1276 | assert_equal 1, assigns(:next_issue_id) |
|
1276 | assert_equal 1, assigns(:next_issue_id) | |
1277 |
|
1277 | |||
1278 | assert_select 'div.next-prev-links' do |
|
1278 | assert_select 'div.next-prev-links' do | |
1279 | assert_select 'a[href=/issues/2]', :text => /Previous/ |
|
1279 | assert_select 'a[href="/issues/2"]', :text => /Previous/ | |
1280 | assert_select 'a[href=/issues/1]', :text => /Next/ |
|
1280 | assert_select 'a[href="/issues/1"]', :text => /Next/ | |
1281 | end |
|
1281 | end | |
1282 | end |
|
1282 | end | |
1283 |
|
1283 | |||
@@ -1285,7 +1285,7 class IssuesControllerTest < ActionController::TestCase | |||||
1285 | get :show, :id => 2 |
|
1285 | get :show, :id => 2 | |
1286 | assert_response :success |
|
1286 | assert_response :success | |
1287 | assert_select '.assigned-to' do |
|
1287 | assert_select '.assigned-to' do | |
1288 | assert_select 'a[href=/users/3]' |
|
1288 | assert_select 'a[href="/users/3"]' | |
1289 | end |
|
1289 | end | |
1290 | end |
|
1290 | end | |
1291 |
|
1291 | |||
@@ -1311,7 +1311,7 class IssuesControllerTest < ActionController::TestCase | |||||
1311 | get :show, :id => 1 |
|
1311 | get :show, :id => 1 | |
1312 | assert_select 'div#watchers ul' do |
|
1312 | assert_select 'div#watchers ul' do | |
1313 | assert_select 'li' do |
|
1313 | assert_select 'li' do | |
1314 | assert_select 'a[href=/users/2]' |
|
1314 | assert_select 'a[href="/users/2"]' | |
1315 | assert_select 'a img[alt=Delete]' |
|
1315 | assert_select 'a img[alt=Delete]' | |
1316 | end |
|
1316 | end | |
1317 | end |
|
1317 | end | |
@@ -1328,7 +1328,7 class IssuesControllerTest < ActionController::TestCase | |||||
1328 | assert_select 'div#watchers ul' do |
|
1328 | assert_select 'div#watchers ul' do | |
1329 | assert_select 'li' do |
|
1329 | assert_select 'li' do | |
1330 | assert_select 'img.gravatar' |
|
1330 | assert_select 'img.gravatar' | |
1331 | assert_select 'a[href=/users/2]' |
|
1331 | assert_select 'a[href="/users/2"]' | |
1332 | assert_select 'a img[alt=Delete]' |
|
1332 | assert_select 'a img[alt=Delete]' | |
1333 | end |
|
1333 | end | |
1334 | end |
|
1334 | end | |
@@ -1343,8 +1343,8 class IssuesControllerTest < ActionController::TestCase | |||||
1343 | end |
|
1343 | end | |
1344 |
|
1344 | |||
1345 | assert_select 'div.thumbnails' do |
|
1345 | assert_select 'div.thumbnails' do | |
1346 | assert_select 'a[href=/attachments/16/testfile.png]' do |
|
1346 | assert_select 'a[href="/attachments/16/testfile.png"]' do | |
1347 | assert_select 'img[src=/attachments/thumbnail/16]' |
|
1347 | assert_select 'img[src="/attachments/thumbnail/16"]' | |
1348 | end |
|
1348 | end | |
1349 | end |
|
1349 | end | |
1350 | end |
|
1350 | end | |
@@ -1511,7 +1511,7 class IssuesControllerTest < ActionController::TestCase | |||||
1511 | # Be sure we don't display inactive IssuePriorities |
|
1511 | # Be sure we don't display inactive IssuePriorities | |
1512 | assert ! IssuePriority.find(15).active? |
|
1512 | assert ! IssuePriority.find(15).active? | |
1513 | assert_select 'select[name=?]', 'issue[priority_id]' do |
|
1513 | assert_select 'select[name=?]', 'issue[priority_id]' do | |
1514 | assert_select 'option[value=15]', 0 |
|
1514 | assert_select 'option[value="15"]', 0 | |
1515 | end |
|
1515 | end | |
1516 | end |
|
1516 | end | |
1517 |
|
1517 | |||
@@ -1551,9 +1551,9 class IssuesControllerTest < ActionController::TestCase | |||||
1551 | assert_response :success |
|
1551 | assert_response :success | |
1552 | assert_template 'new' |
|
1552 | assert_template 'new' | |
1553 | assert_select 'select[name=?]', 'issue[status_id]' do |
|
1553 | assert_select 'select[name=?]', 'issue[status_id]' do | |
1554 | assert_select 'option[value=1][selected=selected]' |
|
1554 | assert_select 'option[value="1"][selected=selected]' | |
1555 | end |
|
1555 | end | |
1556 | assert_select 'input[name=was_default_status][value=1]' |
|
1556 | assert_select 'input[name=was_default_status][value="1"]' | |
1557 | end |
|
1557 | end | |
1558 |
|
1558 | |||
1559 | def test_get_new_with_list_custom_field |
|
1559 | def test_get_new_with_list_custom_field | |
@@ -1595,7 +1595,7 class IssuesControllerTest < ActionController::TestCase | |||||
1595 |
|
1595 | |||
1596 | assert_select 'select[name=?][multiple=multiple]', "issue[custom_field_values][#{field.id}][]" do |
|
1596 | assert_select 'select[name=?][multiple=multiple]', "issue[custom_field_values][#{field.id}][]" do | |
1597 | assert_select 'option', Project.find(1).users.count |
|
1597 | assert_select 'option', Project.find(1).users.count | |
1598 | assert_select 'option[value=2]', :text => 'John Smith' |
|
1598 | assert_select 'option[value="2"]', :text => 'John Smith' | |
1599 | end |
|
1599 | end | |
1600 | assert_select 'input[name=?][type=hidden][value=?]', "issue[custom_field_values][#{field.id}][]", '' |
|
1600 | assert_select 'input[name=?][type=hidden][value=?]', "issue[custom_field_values][#{field.id}][]", '' | |
1601 | end |
|
1601 | end | |
@@ -1662,7 +1662,7 class IssuesControllerTest < ActionController::TestCase | |||||
1662 | assert_equal 'Custom field value', issue.custom_field_value(2) |
|
1662 | assert_equal 'Custom field value', issue.custom_field_value(2) | |
1663 |
|
1663 | |||
1664 | assert_select 'select[name=?]', 'issue[tracker_id]' do |
|
1664 | assert_select 'select[name=?]', 'issue[tracker_id]' do | |
1665 | assert_select 'option[value=3][selected=selected]' |
|
1665 | assert_select 'option[value="3"][selected=selected]' | |
1666 | end |
|
1666 | end | |
1667 | assert_select 'textarea[name=?]', 'issue[description]', :text => /Prefilled/ |
|
1667 | assert_select 'textarea[name=?]', 'issue[description]', :text => /Prefilled/ | |
1668 | assert_select 'input[name=?][value=?]', 'issue[custom_field_values][2]', 'Custom field value' |
|
1668 | assert_select 'input[name=?][value=?]', 'issue[custom_field_values][2]', 'Custom field value' | |
@@ -2176,7 +2176,7 class IssuesControllerTest < ActionController::TestCase | |||||
2176 |
|
2176 | |||
2177 | assert_select 'textarea[name=?]', 'issue[description]', :text => 'This is a description' |
|
2177 | assert_select 'textarea[name=?]', 'issue[description]', :text => 'This is a description' | |
2178 | assert_select 'select[name=?]', 'issue[priority_id]' do |
|
2178 | assert_select 'select[name=?]', 'issue[priority_id]' do | |
2179 | assert_select 'option[value=6][selected=selected]', :text => 'High' |
|
2179 | assert_select 'option[value="6"][selected=selected]', :text => 'High' | |
2180 | end |
|
2180 | end | |
2181 | # Custom fields |
|
2181 | # Custom fields | |
2182 | assert_select 'select[name=?]', 'issue[custom_field_values][1]' do |
|
2182 | assert_select 'select[name=?]', 'issue[custom_field_values][1]' do | |
@@ -2195,9 +2195,9 class IssuesControllerTest < ActionController::TestCase | |||||
2195 | assert_response :success |
|
2195 | assert_response :success | |
2196 | assert_template 'new' |
|
2196 | assert_template 'new' | |
2197 |
|
2197 | |||
2198 | assert_select 'input[name=?][value=2]:not(checked)', 'issue[watcher_user_ids][]' |
|
2198 | assert_select 'input[name=?][value="2"]:not(checked)', 'issue[watcher_user_ids][]' | |
2199 | assert_select 'input[name=?][value=3][checked=checked]', 'issue[watcher_user_ids][]' |
|
2199 | assert_select 'input[name=?][value="3"][checked=checked]', 'issue[watcher_user_ids][]' | |
2200 | assert_select 'input[name=?][value=8][checked=checked]', 'issue[watcher_user_ids][]' |
|
2200 | assert_select 'input[name=?][value="8"][checked=checked]', 'issue[watcher_user_ids][]' | |
2201 | end |
|
2201 | end | |
2202 |
|
2202 | |||
2203 | def test_post_create_should_ignore_non_safe_attributes |
|
2203 | def test_post_create_should_ignore_non_safe_attributes | |
@@ -2474,14 +2474,14 class IssuesControllerTest < ActionController::TestCase | |||||
2474 |
|
2474 | |||
2475 | assert_select 'form[id=issue-form][action=/projects/ecookbook/issues]' do |
|
2475 | assert_select 'form[id=issue-form][action=/projects/ecookbook/issues]' do | |
2476 | assert_select 'select[name=?]', 'issue[project_id]' do |
|
2476 | assert_select 'select[name=?]', 'issue[project_id]' do | |
2477 | assert_select 'option[value=1][selected=selected]', :text => 'eCookbook' |
|
2477 | assert_select 'option[value="1"][selected=selected]', :text => 'eCookbook' | |
2478 | assert_select 'option[value=2]:not([selected])', :text => 'OnlineStore' |
|
2478 | assert_select 'option[value="2"]:not([selected])', :text => 'OnlineStore' | |
2479 | end |
|
2479 | end | |
2480 | assert_select 'input[name=copy_from][value=1]' |
|
2480 | assert_select 'input[name=copy_from][value="1"]' | |
2481 | end |
|
2481 | end | |
2482 |
|
2482 | |||
2483 | # "New issue" menu item should not link to copy |
|
2483 | # "New issue" menu item should not link to copy | |
2484 | assert_select '#main-menu a.new-issue[href=/projects/ecookbook/issues/new]' |
|
2484 | assert_select '#main-menu a.new-issue[href="/projects/ecookbook/issues/new"]' | |
2485 | end |
|
2485 | end | |
2486 |
|
2486 | |||
2487 | def test_new_as_copy_with_attachments_should_show_copy_attachments_checkbox |
|
2487 | def test_new_as_copy_with_attachments_should_show_copy_attachments_checkbox | |
@@ -2490,7 +2490,7 class IssuesControllerTest < ActionController::TestCase | |||||
2490 | assert issue.attachments.count > 0 |
|
2490 | assert issue.attachments.count > 0 | |
2491 | get :new, :project_id => 1, :copy_from => 3 |
|
2491 | get :new, :project_id => 1, :copy_from => 3 | |
2492 |
|
2492 | |||
2493 | assert_select 'input[name=copy_attachments][type=checkbox][checked=checked][value=1]' |
|
2493 | assert_select 'input[name=copy_attachments][type=checkbox][checked=checked][value="1"]' | |
2494 | end |
|
2494 | end | |
2495 |
|
2495 | |||
2496 | def test_new_as_copy_without_attachments_should_not_show_copy_attachments_checkbox |
|
2496 | def test_new_as_copy_without_attachments_should_not_show_copy_attachments_checkbox | |
@@ -2507,7 +2507,7 class IssuesControllerTest < ActionController::TestCase | |||||
2507 | issue = Issue.generate_with_descendants! |
|
2507 | issue = Issue.generate_with_descendants! | |
2508 | get :new, :project_id => 1, :copy_from => issue.id |
|
2508 | get :new, :project_id => 1, :copy_from => issue.id | |
2509 |
|
2509 | |||
2510 | assert_select 'input[type=checkbox][name=copy_subtasks][checked=checked][value=1]' |
|
2510 | assert_select 'input[type=checkbox][name=copy_subtasks][checked=checked][value="1"]' | |
2511 | end |
|
2511 | end | |
2512 |
|
2512 | |||
2513 | def test_new_as_copy_with_invalid_issue_should_respond_with_404 |
|
2513 | def test_new_as_copy_with_invalid_issue_should_respond_with_404 | |
@@ -2650,10 +2650,10 class IssuesControllerTest < ActionController::TestCase | |||||
2650 |
|
2650 | |||
2651 | assert_select 'form#issue-form[action=/projects/ecookbook/issues]' do |
|
2651 | assert_select 'form#issue-form[action=/projects/ecookbook/issues]' do | |
2652 | assert_select 'select[name=?]', 'issue[project_id]' do |
|
2652 | assert_select 'select[name=?]', 'issue[project_id]' do | |
2653 | assert_select 'option[value=1]:not([selected])', :text => 'eCookbook' |
|
2653 | assert_select 'option[value="1"]:not([selected])', :text => 'eCookbook' | |
2654 | assert_select 'option[value=2][selected=selected]', :text => 'OnlineStore' |
|
2654 | assert_select 'option[value="2"][selected=selected]', :text => 'OnlineStore' | |
2655 | end |
|
2655 | end | |
2656 | assert_select 'input[name=copy_from][value=1]' |
|
2656 | assert_select 'input[name=copy_from][value="1"]' | |
2657 | end |
|
2657 | end | |
2658 | end |
|
2658 | end | |
2659 |
|
2659 | |||
@@ -2680,7 +2680,7 class IssuesControllerTest < ActionController::TestCase | |||||
2680 | # Be sure we don't display inactive IssuePriorities |
|
2680 | # Be sure we don't display inactive IssuePriorities | |
2681 | assert ! IssuePriority.find(15).active? |
|
2681 | assert ! IssuePriority.find(15).active? | |
2682 | assert_select 'select[name=?]', 'issue[priority_id]' do |
|
2682 | assert_select 'select[name=?]', 'issue[priority_id]' do | |
2683 | assert_select 'option[value=15]', 0 |
|
2683 | assert_select 'option[value="15"]', 0 | |
2684 | end |
|
2684 | end | |
2685 | end |
|
2685 | end | |
2686 |
|
2686 | |||
@@ -2712,17 +2712,17 class IssuesControllerTest < ActionController::TestCase | |||||
2712 |
|
2712 | |||
2713 | assert_equal 5, issue.status_id |
|
2713 | assert_equal 5, issue.status_id | |
2714 | assert_select 'select[name=?]', 'issue[status_id]' do |
|
2714 | assert_select 'select[name=?]', 'issue[status_id]' do | |
2715 | assert_select 'option[value=5][selected=selected]', :text => 'Closed' |
|
2715 | assert_select 'option[value="5"][selected=selected]', :text => 'Closed' | |
2716 | end |
|
2716 | end | |
2717 |
|
2717 | |||
2718 | assert_equal 7, issue.priority_id |
|
2718 | assert_equal 7, issue.priority_id | |
2719 | assert_select 'select[name=?]', 'issue[priority_id]' do |
|
2719 | assert_select 'select[name=?]', 'issue[priority_id]' do | |
2720 | assert_select 'option[value=7][selected=selected]', :text => 'Urgent' |
|
2720 | assert_select 'option[value="7"][selected=selected]', :text => 'Urgent' | |
2721 | end |
|
2721 | end | |
2722 |
|
2722 | |||
2723 | assert_select 'input[name=?][value=2.5]', 'time_entry[hours]' |
|
2723 | assert_select 'input[name=?][value=2.5]', 'time_entry[hours]' | |
2724 | assert_select 'select[name=?]', 'time_entry[activity_id]' do |
|
2724 | assert_select 'select[name=?]', 'time_entry[activity_id]' do | |
2725 | assert_select 'option[value=10][selected=selected]', :text => 'Development' |
|
2725 | assert_select 'option[value="10"][selected=selected]', :text => 'Development' | |
2726 | end |
|
2726 | end | |
2727 | assert_select 'input[name=?][value=test_get_edit_with_params]', 'time_entry[comments]' |
|
2727 | assert_select 'input[name=?][value=test_get_edit_with_params]', 'time_entry[comments]' | |
2728 | end |
|
2728 | end | |
@@ -3302,7 +3302,7 class IssuesControllerTest < ActionController::TestCase | |||||
3302 |
|
3302 | |||
3303 | assert_select 'form#bulk_edit_form[action=?]', '/issues/bulk_update' do |
|
3303 | assert_select 'form#bulk_edit_form[action=?]', '/issues/bulk_update' do | |
3304 | assert_select 'input[name=?]', 'ids[]', 2 |
|
3304 | assert_select 'input[name=?]', 'ids[]', 2 | |
3305 | assert_select 'input[name=?][value=1][type=hidden]', 'ids[]' |
|
3305 | assert_select 'input[name=?][value="1"][type=hidden]', 'ids[]' | |
3306 |
|
3306 | |||
3307 | assert_select 'select[name=?]', 'issue[project_id]' |
|
3307 | assert_select 'select[name=?]', 'issue[project_id]' | |
3308 | assert_select 'input[name=?]', 'issue[parent_issue_id]' |
|
3308 | assert_select 'input[name=?]', 'issue[parent_issue_id]' | |
@@ -3320,7 +3320,7 class IssuesControllerTest < ActionController::TestCase | |||||
3320 | # Be sure we don't display inactive IssuePriorities |
|
3320 | # Be sure we don't display inactive IssuePriorities | |
3321 | assert ! IssuePriority.find(15).active? |
|
3321 | assert ! IssuePriority.find(15).active? | |
3322 | assert_select 'select[name=?]', 'issue[priority_id]' do |
|
3322 | assert_select 'select[name=?]', 'issue[priority_id]' do | |
3323 | assert_select 'option[value=15]', 0 |
|
3323 | assert_select 'option[value="15"]', 0 | |
3324 | end |
|
3324 | end | |
3325 | end |
|
3325 | end | |
3326 | end |
|
3326 | end | |
@@ -3736,7 +3736,7 class IssuesControllerTest < ActionController::TestCase | |||||
3736 | assert_response :success |
|
3736 | assert_response :success | |
3737 | assert_template 'bulk_edit' |
|
3737 | assert_template 'bulk_edit' | |
3738 | assert_select 'select[name=?]', 'issue[tracker_id]' do |
|
3738 | assert_select 'select[name=?]', 'issue[tracker_id]' do | |
3739 | assert_select 'option[value=2][selected=selected]' |
|
3739 | assert_select 'option[value="2"][selected=selected]' | |
3740 | end |
|
3740 | end | |
3741 | assert_select 'input[name=?][value=?]', 'issue[start_date]', 'foo' |
|
3741 | assert_select 'input[name=?][value=?]', 'issue[start_date]', 'foo' | |
3742 | end |
|
3742 | end | |
@@ -4045,7 +4045,7 class IssuesControllerTest < ActionController::TestCase | |||||
4045 | get :index |
|
4045 | get :index | |
4046 |
|
4046 | |||
4047 | assert_select 'div#quick-search form' do |
|
4047 | assert_select 'div#quick-search form' do | |
4048 | assert_select 'input[name=issues][value=1][type=hidden]' |
|
4048 | assert_select 'input[name=issues][value="1"][type=hidden]' | |
4049 | end |
|
4049 | end | |
4050 | end |
|
4050 | end | |
4051 | end |
|
4051 | end |
@@ -75,7 +75,7 class IssuesControllerTransactionTest < ActionController::TestCase | |||||
75 | assert_select 'input[name=?][value=?]', 'conflict_resolution', 'add_notes' |
|
75 | assert_select 'input[name=?][value=?]', 'conflict_resolution', 'add_notes' | |
76 | assert_select 'label' do |
|
76 | assert_select 'label' do | |
77 | assert_select 'input[name=?][value=?]', 'conflict_resolution', 'cancel' |
|
77 | assert_select 'input[name=?][value=?]', 'conflict_resolution', 'cancel' | |
78 | assert_select 'a[href=/issues/2]' |
|
78 | assert_select 'a[href="/issues/2"]' | |
79 | end |
|
79 | end | |
80 | end |
|
80 | end | |
81 |
|
81 |
@@ -46,7 +46,7 class MyControllerTest < ActionController::TestCase | |||||
46 | get :page |
|
46 | get :page | |
47 | assert_response :success |
|
47 | assert_response :success | |
48 | assert_select 'tr.time-entry' do |
|
48 | assert_select 'tr.time-entry' do | |
49 | assert_select 'td.subject a[href=/issues/1]' |
|
49 | assert_select 'td.subject a[href="/issues/1"]' | |
50 | assert_select 'td.hours', :text => '2.50' |
|
50 | assert_select 'td.hours', :text => '2.50' | |
51 | end |
|
51 | end | |
52 | end |
|
52 | end | |
@@ -119,7 +119,7 class MyControllerTest < ActionController::TestCase | |||||
119 |
|
119 | |||
120 | def test_my_account_should_show_destroy_link |
|
120 | def test_my_account_should_show_destroy_link | |
121 | get :account |
|
121 | get :account | |
122 | assert_select 'a[href=/my/account/destroy]' |
|
122 | assert_select 'a[href="/my/account/destroy"]' | |
123 | end |
|
123 | end | |
124 |
|
124 | |||
125 | def test_get_destroy_should_display_the_destroy_confirmation |
|
125 | def test_get_destroy_should_display_the_destroy_confirmation |
@@ -28,7 +28,7 class PrincipalMembershipsControllerTest < ActionController::TestCase | |||||
28 | get :new, :user_id => 7 |
|
28 | get :new, :user_id => 7 | |
29 | assert_response :success |
|
29 | assert_response :success | |
30 | assert_select 'label', :text => 'eCookbook' do |
|
30 | assert_select 'label', :text => 'eCookbook' do | |
31 | assert_select 'input[name=?][value=1]:not([disabled])', 'membership[project_ids][]' |
|
31 | assert_select 'input[name=?][value="1"]:not([disabled])', 'membership[project_ids][]' | |
32 | end |
|
32 | end | |
33 | end |
|
33 | end | |
34 |
|
34 | |||
@@ -38,7 +38,7 class PrincipalMembershipsControllerTest < ActionController::TestCase | |||||
38 | get :new, :user_id => 7 |
|
38 | get :new, :user_id => 7 | |
39 | assert_response :success |
|
39 | assert_response :success | |
40 | assert_select 'label', :text => 'eCookbook' do |
|
40 | assert_select 'label', :text => 'eCookbook' do | |
41 | assert_select 'input[name=?][value=1][disabled=disabled]', 'membership[project_ids][]' |
|
41 | assert_select 'input[name=?][value="1"][disabled=disabled]', 'membership[project_ids][]' | |
42 | end |
|
42 | end | |
43 | end |
|
43 | end | |
44 |
|
44 |
@@ -103,9 +103,9 class ProjectsControllerTest < ActionController::TestCase | |||||
103 |
|
103 | |||
104 | assert_select 'select[name=?]', 'project[parent_id]' do |
|
104 | assert_select 'select[name=?]', 'project[parent_id]' do | |
105 | # parent project selected |
|
105 | # parent project selected | |
106 | assert_select 'option[value=1][selected=selected]' |
|
106 | assert_select 'option[value="1"][selected=selected]' | |
107 | # no empty value |
|
107 | # no empty value | |
108 | assert_select 'option[value=]', 0 |
|
108 | assert_select 'option[value=""]', 0 | |
109 | end |
|
109 | end | |
110 | end |
|
110 | end | |
111 |
|
111 |
@@ -35,7 +35,7 class QueriesControllerTest < ActionController::TestCase | |||||
35 | get :new, :project_id => 1 |
|
35 | get :new, :project_id => 1 | |
36 | assert_response :success |
|
36 | assert_response :success | |
37 | assert_template 'new' |
|
37 | assert_template 'new' | |
38 | assert_select 'input[name=?][value=0][checked=checked]', 'query[visibility]' |
|
38 | assert_select 'input[name=?][value="0"][checked=checked]', 'query[visibility]' | |
39 | assert_tag :tag => 'input', :attributes => { :type => 'checkbox', |
|
39 | assert_tag :tag => 'input', :attributes => { :type => 'checkbox', | |
40 | :name => 'query_is_for_all', |
|
40 | :name => 'query_is_for_all', | |
41 | :checked => nil, |
|
41 | :checked => nil, | |
@@ -197,7 +197,7 class QueriesControllerTest < ActionController::TestCase | |||||
197 | get :edit, :id => 4 |
|
197 | get :edit, :id => 4 | |
198 | assert_response :success |
|
198 | assert_response :success | |
199 | assert_template 'edit' |
|
199 | assert_template 'edit' | |
200 | assert_select 'input[name=?][value=2][checked=checked]', 'query[visibility]' |
|
200 | assert_select 'input[name=?][value="2"][checked=checked]', 'query[visibility]' | |
201 | assert_tag :tag => 'input', :attributes => { :type => 'checkbox', |
|
201 | assert_tag :tag => 'input', :attributes => { :type => 'checkbox', | |
202 | :name => 'query_is_for_all', |
|
202 | :name => 'query_is_for_all', | |
203 | :checked => 'checked', |
|
203 | :checked => 'checked', | |
@@ -233,7 +233,7 class QueriesControllerTest < ActionController::TestCase | |||||
233 | get :edit, :id => 1 |
|
233 | get :edit, :id => 1 | |
234 | assert_response :success |
|
234 | assert_response :success | |
235 | assert_template 'edit' |
|
235 | assert_template 'edit' | |
236 | assert_select 'input[name=?][value=2][checked=checked]', 'query[visibility]' |
|
236 | assert_select 'input[name=?][value="2"][checked=checked]', 'query[visibility]' | |
237 | assert_tag :tag => 'input', :attributes => { :type => 'checkbox', |
|
237 | assert_tag :tag => 'input', :attributes => { :type => 'checkbox', | |
238 | :name => 'query_is_for_all', |
|
238 | :name => 'query_is_for_all', | |
239 | :checked => nil, |
|
239 | :checked => nil, |
@@ -62,7 +62,7 class RepositoriesSubversionControllerTest < ActionController::TestCase | |||||
62 | entry = assigns(:entries).detect {|e| e.name == 'subversion_test'} |
|
62 | entry = assigns(:entries).detect {|e| e.name == 'subversion_test'} | |
63 | assert_not_nil entry |
|
63 | assert_not_nil entry | |
64 | assert_equal 'dir', entry.kind |
|
64 | assert_equal 'dir', entry.kind | |
65 | assert_select 'tr.dir a[href=/projects/subproject1/repository/show/subversion_test]' |
|
65 | assert_select 'tr.dir a[href="/projects/subproject1/repository/show/subversion_test"]' | |
66 |
|
66 | |||
67 | assert_tag 'input', :attributes => {:name => 'rev'} |
|
67 | assert_tag 'input', :attributes => {:name => 'rev'} | |
68 | assert_tag 'a', :content => 'Statistics' |
|
68 | assert_tag 'a', :content => 'Statistics' | |
@@ -80,9 +80,9 class RepositoriesSubversionControllerTest < ActionController::TestCase | |||||
80 | get :show, :id => PRJ_ID, :repository_id => 'svn' |
|
80 | get :show, :id => PRJ_ID, :repository_id => 'svn' | |
81 | assert_response :success |
|
81 | assert_response :success | |
82 | assert_template 'show' |
|
82 | assert_template 'show' | |
83 | assert_select 'tr.dir a[href=/projects/subproject1/repository/svn/show/subversion_test]' |
|
83 | assert_select 'tr.dir a[href="/projects/subproject1/repository/svn/show/subversion_test"]' | |
84 | # Repository menu should link to the main repo |
|
84 | # Repository menu should link to the main repo | |
85 | assert_select '#main-menu a[href=/projects/subproject1/repository]' |
|
85 | assert_select '#main-menu a[href="/projects/subproject1/repository"]' | |
86 | end |
|
86 | end | |
87 |
|
87 | |||
88 | def test_browse_directory |
|
88 | def test_browse_directory |
@@ -55,7 +55,7 class RolesControllerTest < ActionController::TestCase | |||||
55 |
|
55 | |||
56 | assert_select 'form' do |
|
56 | assert_select 'form' do | |
57 | # blank name |
|
57 | # blank name | |
58 | assert_select 'input[name=?][value=]', 'role[name]' |
|
58 | assert_select 'input[name=?][value=""]', 'role[name]' | |
59 | # edit_project permission checked |
|
59 | # edit_project permission checked | |
60 | assert_select 'input[type=checkbox][name=?][value=edit_project][checked=checked]', 'role[permissions][]' |
|
60 | assert_select 'input[type=checkbox][name=?][value=edit_project][checked=checked]', 'role[permissions][]' | |
61 | # add_project permission not checked |
|
61 | # add_project permission not checked | |
@@ -63,7 +63,7 class RolesControllerTest < ActionController::TestCase | |||||
63 | assert_select 'input[type=checkbox][name=?][value=add_project][checked=checked]', 'role[permissions][]', 0 |
|
63 | assert_select 'input[type=checkbox][name=?][value=add_project][checked=checked]', 'role[permissions][]', 0 | |
64 | # workflow copy selected |
|
64 | # workflow copy selected | |
65 | assert_select 'select[name=?]', 'copy_workflow_from' do |
|
65 | assert_select 'select[name=?]', 'copy_workflow_from' do | |
66 | assert_select 'option[value=2][selected=selected]' |
|
66 | assert_select 'option[value="2"][selected=selected]' | |
67 | end |
|
67 | end | |
68 | end |
|
68 | end | |
69 | end |
|
69 | end |
@@ -93,19 +93,19 class SettingsControllerTest < ActionController::TestCase | |||||
93 | assert_select 'tr.commit-keywords:nth-child(1)' do |
|
93 | assert_select 'tr.commit-keywords:nth-child(1)' do | |
94 | assert_select 'input[name=?][value=?]', 'settings[commit_update_keywords][keywords][]', 'fixes, resolves' |
|
94 | assert_select 'input[name=?][value=?]', 'settings[commit_update_keywords][keywords][]', 'fixes, resolves' | |
95 | assert_select 'select[name=?]', 'settings[commit_update_keywords][status_id][]' do |
|
95 | assert_select 'select[name=?]', 'settings[commit_update_keywords][status_id][]' do | |
96 | assert_select 'option[value=3][selected=selected]' |
|
96 | assert_select 'option[value="3"][selected=selected]' | |
97 | end |
|
97 | end | |
98 | end |
|
98 | end | |
99 | assert_select 'tr.commit-keywords:nth-child(2)' do |
|
99 | assert_select 'tr.commit-keywords:nth-child(2)' do | |
100 | assert_select 'input[name=?][value=?]', 'settings[commit_update_keywords][keywords][]', 'closes' |
|
100 | assert_select 'input[name=?][value=?]', 'settings[commit_update_keywords][keywords][]', 'closes' | |
101 | assert_select 'select[name=?]', 'settings[commit_update_keywords][status_id][]' do |
|
101 | assert_select 'select[name=?]', 'settings[commit_update_keywords][status_id][]' do | |
102 | assert_select 'option[value=5][selected=selected]', :text => 'Closed' |
|
102 | assert_select 'option[value="5"][selected=selected]', :text => 'Closed' | |
103 | end |
|
103 | end | |
104 | assert_select 'select[name=?]', 'settings[commit_update_keywords][done_ratio][]' do |
|
104 | assert_select 'select[name=?]', 'settings[commit_update_keywords][done_ratio][]' do | |
105 | assert_select 'option[value=100][selected=selected]', :text => '100 %' |
|
105 | assert_select 'option[value="100"][selected=selected]', :text => '100 %' | |
106 | end |
|
106 | end | |
107 | assert_select 'select[name=?]', 'settings[commit_update_keywords][if_tracker_id][]' do |
|
107 | assert_select 'select[name=?]', 'settings[commit_update_keywords][if_tracker_id][]' do | |
108 | assert_select 'option[value=2][selected=selected]', :text => 'Feature request' |
|
108 | assert_select 'option[value="2"][selected=selected]', :text => 'Feature request' | |
109 | end |
|
109 | end | |
110 | end |
|
110 | end | |
111 | end |
|
111 | end |
@@ -37,7 +37,7 class TimelogControllerTest < ActionController::TestCase | |||||
37 | assert_select 'input[name=?][type=hidden]', 'issue_id', 0 |
|
37 | assert_select 'input[name=?][type=hidden]', 'issue_id', 0 | |
38 | assert_select 'select[name=?]', 'time_entry[project_id]' do |
|
38 | assert_select 'select[name=?]', 'time_entry[project_id]' do | |
39 | # blank option for project |
|
39 | # blank option for project | |
40 | assert_select 'option[value=]' |
|
40 | assert_select 'option[value=""]' | |
41 | end |
|
41 | end | |
42 | end |
|
42 | end | |
43 |
|
43 | |||
@@ -67,7 +67,7 class TimelogControllerTest < ActionController::TestCase | |||||
67 | assert_response :success |
|
67 | assert_response :success | |
68 | assert_template 'new' |
|
68 | assert_template 'new' | |
69 | assert_select 'select[name=?]', 'time_entry[project_id]' do |
|
69 | assert_select 'select[name=?]', 'time_entry[project_id]' do | |
70 | assert_select 'option[value=1][selected=selected]' |
|
70 | assert_select 'option[value="1"][selected=selected]' | |
71 | end |
|
71 | end | |
72 | end |
|
72 | end | |
73 |
|
73 | |||
@@ -361,8 +361,8 class TimelogControllerTest < ActionController::TestCase | |||||
361 |
|
361 | |||
362 | # Activities |
|
362 | # Activities | |
363 | assert_select 'select[name=?]', 'time_entry[activity_id]' do |
|
363 | assert_select 'select[name=?]', 'time_entry[activity_id]' do | |
364 | assert_select 'option[value=]', :text => '(No change)' |
|
364 | assert_select 'option[value=""]', :text => '(No change)' | |
365 | assert_select 'option[value=9]', :text => 'Design' |
|
365 | assert_select 'option[value="9"]', :text => 'Design' | |
366 | end |
|
366 | end | |
367 | end |
|
367 | end | |
368 | end |
|
368 | end |
@@ -127,7 +127,7 class TrackersControllerTest < ActionController::TestCase | |||||
127 | assert_select 'input[name=?][value=category_id]', 'tracker[core_fields][]' |
|
127 | assert_select 'input[name=?][value=category_id]', 'tracker[core_fields][]' | |
128 | assert_select 'input[name=?][value=category_id][checked=checked]', 'tracker[core_fields][]', 0 |
|
128 | assert_select 'input[name=?][value=category_id][checked=checked]', 'tracker[core_fields][]', 0 | |
129 |
|
129 | |||
130 | assert_select 'input[name=?][value=][type=hidden]', 'tracker[core_fields][]' |
|
130 | assert_select 'input[name=?][value=""][type=hidden]', 'tracker[core_fields][]' | |
131 | end |
|
131 | end | |
132 |
|
132 | |||
133 | def test_update |
|
133 | def test_update | |
@@ -187,10 +187,10 class TrackersControllerTest < ActionController::TestCase | |||||
187 |
|
187 | |||
188 | assert_select 'form' do |
|
188 | assert_select 'form' do | |
189 | assert_select 'input[type=checkbox][name=?][value=assigned_to_id]', 'trackers[1][core_fields][]' |
|
189 | assert_select 'input[type=checkbox][name=?][value=assigned_to_id]', 'trackers[1][core_fields][]' | |
190 | assert_select 'input[type=checkbox][name=?][value=2]', 'trackers[1][custom_field_ids][]' |
|
190 | assert_select 'input[type=checkbox][name=?][value="2"]', 'trackers[1][custom_field_ids][]' | |
191 |
|
191 | |||
192 | assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][core_fields][]' |
|
192 | assert_select 'input[type=hidden][name=?][value=""]', 'trackers[1][core_fields][]' | |
193 | assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][custom_field_ids][]' |
|
193 | assert_select 'input[type=hidden][name=?][value=""]', 'trackers[1][custom_field_ids][]' | |
194 | end |
|
194 | end | |
195 | end |
|
195 | end | |
196 |
|
196 |
@@ -64,7 +64,7 class UsersControllerTest < ActionController::TestCase | |||||
64 | assert users.any? |
|
64 | assert users.any? | |
65 | assert_equal([], (users - Group.find(10).users)) |
|
65 | assert_equal([], (users - Group.find(10).users)) | |
66 | assert_select 'select[name=group_id]' do |
|
66 | assert_select 'select[name=group_id]' do | |
67 | assert_select 'option[value=10][selected=selected]' |
|
67 | assert_select 'option[value="10"][selected=selected]' | |
68 | end |
|
68 | end | |
69 | end |
|
69 | end | |
70 |
|
70 | |||
@@ -263,7 +263,7 class UsersControllerTest < ActionController::TestCase | |||||
263 | assert_template 'new' |
|
263 | assert_template 'new' | |
264 |
|
264 | |||
265 | assert_select 'select#pref_time_zone option[selected=selected]', :text => /Paris/ |
|
265 | assert_select 'select#pref_time_zone option[selected=selected]', :text => /Paris/ | |
266 | assert_select 'input#pref_no_self_notified[value=1][checked=checked]' |
|
266 | assert_select 'input#pref_no_self_notified[value="1"][checked=checked]' | |
267 | end |
|
267 | end | |
268 |
|
268 | |||
269 | def test_edit |
|
269 | def test_edit |
@@ -179,10 +179,10 class WatchersControllerTest < ActionController::TestCase | |||||
179 | xhr :get, :autocomplete_for_user, :q => 'mi', :project_id => 'ecookbook' |
|
179 | xhr :get, :autocomplete_for_user, :q => 'mi', :project_id => 'ecookbook' | |
180 | assert_response :success |
|
180 | assert_response :success | |
181 | assert_select 'input', :count => 4 |
|
181 | assert_select 'input', :count => 4 | |
182 | assert_select 'input[name=?][value=1]', 'watcher[user_ids][]' |
|
182 | assert_select 'input[name=?][value="1"]', 'watcher[user_ids][]' | |
183 | assert_select 'input[name=?][value=2]', 'watcher[user_ids][]' |
|
183 | assert_select 'input[name=?][value="2"]', 'watcher[user_ids][]' | |
184 | assert_select 'input[name=?][value=8]', 'watcher[user_ids][]' |
|
184 | assert_select 'input[name=?][value="8"]', 'watcher[user_ids][]' | |
185 | assert_select 'input[name=?][value=9]', 'watcher[user_ids][]' |
|
185 | assert_select 'input[name=?][value="9"]', 'watcher[user_ids][]' | |
186 | end |
|
186 | end | |
187 |
|
187 | |||
188 | def test_search_non_member_on_create |
|
188 | def test_search_non_member_on_create | |
@@ -202,9 +202,9 class WatchersControllerTest < ActionController::TestCase | |||||
202 | :object_type => 'issue', :project_id => 'ecookbook' |
|
202 | :object_type => 'issue', :project_id => 'ecookbook' | |
203 | assert_response :success |
|
203 | assert_response :success | |
204 | assert_select 'input', :count => 3 |
|
204 | assert_select 'input', :count => 3 | |
205 | assert_select 'input[name=?][value=2]', 'watcher[user_ids][]' |
|
205 | assert_select 'input[name=?][value="2"]', 'watcher[user_ids][]' | |
206 | assert_select 'input[name=?][value=8]', 'watcher[user_ids][]' |
|
206 | assert_select 'input[name=?][value="8"]', 'watcher[user_ids][]' | |
207 | assert_select 'input[name=?][value=9]', 'watcher[user_ids][]' |
|
207 | assert_select 'input[name=?][value="9"]', 'watcher[user_ids][]' | |
208 | end |
|
208 | end | |
209 |
|
209 | |||
210 | def test_search_and_add_non_member_on_update |
|
210 | def test_search_and_add_non_member_on_update |
@@ -116,7 +116,7 class WelcomeControllerTest < ActionController::TestCase | |||||
116 | @request.session[:user_id] = 2 |
|
116 | @request.session[:user_id] = 2 | |
117 |
|
117 | |||
118 | get :index |
|
118 | get :index | |
119 | assert_select 'a[href=/logout][data-method=post]', :text => 'Sign out' |
|
119 | assert_select 'a[href="/logout"][data-method=post]', :text => 'Sign out' | |
120 | end |
|
120 | end | |
121 |
|
121 | |||
122 | def test_call_hook_mixed_in |
|
122 | def test_call_hook_mixed_in |
@@ -55,9 +55,9 class WorkflowsControllerTest < ActionController::TestCase | |||||
55 | assert_equal [2, 3, 5], assigns(:statuses).collect(&:id) |
|
55 | assert_equal [2, 3, 5], assigns(:statuses).collect(&:id) | |
56 |
|
56 | |||
57 | # allowed transitions |
|
57 | # allowed transitions | |
58 | assert_select 'input[type=checkbox][name=?][value=1][checked=checked]', 'transitions[3][5][always]' |
|
58 | assert_select 'input[type=checkbox][name=?][value="1"][checked=checked]', 'transitions[3][5][always]' | |
59 | # not allowed |
|
59 | # not allowed | |
60 | assert_select 'input[type=checkbox][name=?][value=1]:not([checked=checked])', 'transitions[3][2][always]' |
|
60 | assert_select 'input[type=checkbox][name=?][value="1"]:not([checked=checked])', 'transitions[3][2][always]' | |
61 | # unused |
|
61 | # unused | |
62 | assert_select 'input[type=checkbox][name=?]', 'transitions[1][1][always]', 0 |
|
62 | assert_select 'input[type=checkbox][name=?]', 'transitions[1][1][always]', 0 | |
63 | end |
|
63 | end | |
@@ -135,13 +135,13 class WorkflowsControllerTest < ActionController::TestCase | |||||
135 | assert_response :success |
|
135 | assert_response :success | |
136 | assert_template 'permissions' |
|
136 | assert_template 'permissions' | |
137 |
|
137 | |||
138 | assert_select 'input[name=?][value=1]', 'role_id[]' |
|
138 | assert_select 'input[name=?][value="1"]', 'role_id[]' | |
139 | assert_select 'input[name=?][value=2]', 'tracker_id[]' |
|
139 | assert_select 'input[name=?][value="2"]', 'tracker_id[]' | |
140 |
|
140 | |||
141 | # Required field |
|
141 | # Required field | |
142 | assert_select 'select[name=?]', 'permissions[2][assigned_to_id]' do |
|
142 | assert_select 'select[name=?]', 'permissions[2][assigned_to_id]' do | |
143 | assert_select 'option[value=]' |
|
143 | assert_select 'option[value=""]' | |
144 | assert_select 'option[value=][selected=selected]', 0 |
|
144 | assert_select 'option[value=""][selected=selected]', 0 | |
145 | assert_select 'option[value=readonly]', :text => 'Read-only' |
|
145 | assert_select 'option[value=readonly]', :text => 'Read-only' | |
146 | assert_select 'option[value=readonly][selected=selected]', 0 |
|
146 | assert_select 'option[value=readonly][selected=selected]', 0 | |
147 | assert_select 'option[value=required]', :text => 'Required' |
|
147 | assert_select 'option[value=required]', :text => 'Required' | |
@@ -150,8 +150,8 class WorkflowsControllerTest < ActionController::TestCase | |||||
150 |
|
150 | |||
151 | # Read-only field |
|
151 | # Read-only field | |
152 | assert_select 'select[name=?]', 'permissions[3][fixed_version_id]' do |
|
152 | assert_select 'select[name=?]', 'permissions[3][fixed_version_id]' do | |
153 | assert_select 'option[value=]' |
|
153 | assert_select 'option[value=""]' | |
154 | assert_select 'option[value=][selected=selected]', 0 |
|
154 | assert_select 'option[value=""][selected=selected]', 0 | |
155 | assert_select 'option[value=readonly]', :text => 'Read-only' |
|
155 | assert_select 'option[value=readonly]', :text => 'Read-only' | |
156 | assert_select 'option[value=readonly][selected=selected]' |
|
156 | assert_select 'option[value=readonly][selected=selected]' | |
157 | assert_select 'option[value=required]', :text => 'Required' |
|
157 | assert_select 'option[value=required]', :text => 'Required' | |
@@ -160,8 +160,8 class WorkflowsControllerTest < ActionController::TestCase | |||||
160 |
|
160 | |||
161 | # Other field |
|
161 | # Other field | |
162 | assert_select 'select[name=?]', 'permissions[3][due_date]' do |
|
162 | assert_select 'select[name=?]', 'permissions[3][due_date]' do | |
163 | assert_select 'option[value=]' |
|
163 | assert_select 'option[value=""]' | |
164 | assert_select 'option[value=][selected=selected]', 0 |
|
164 | assert_select 'option[value=""][selected=selected]', 0 | |
165 | assert_select 'option[value=readonly]', :text => 'Read-only' |
|
165 | assert_select 'option[value=readonly]', :text => 'Read-only' | |
166 | assert_select 'option[value=readonly][selected=selected]', 0 |
|
166 | assert_select 'option[value=readonly][selected=selected]', 0 | |
167 | assert_select 'option[value=required]', :text => 'Required' |
|
167 | assert_select 'option[value=required]', :text => 'Required' | |
@@ -179,7 +179,7 class WorkflowsControllerTest < ActionController::TestCase | |||||
179 | # Custom field that is always required |
|
179 | # Custom field that is always required | |
180 | # The default option is "(Required)" |
|
180 | # The default option is "(Required)" | |
181 | assert_select 'select[name=?]', "permissions[3][#{cf.id}]" do |
|
181 | assert_select 'select[name=?]', "permissions[3][#{cf.id}]" do | |
182 | assert_select 'option[value=]' |
|
182 | assert_select 'option[value=""]' | |
183 | assert_select 'option[value=readonly]', :text => 'Read-only' |
|
183 | assert_select 'option[value=readonly]', :text => 'Read-only' | |
184 | assert_select 'option[value=required]', 0 |
|
184 | assert_select 'option[value=required]', 0 | |
185 | end |
|
185 | end | |
@@ -198,7 +198,7 class WorkflowsControllerTest < ActionController::TestCase | |||||
198 | assert_select 'select[name=?]:not(.disabled)', "permissions[1][#{cf3.id}]" |
|
198 | assert_select 'select[name=?]:not(.disabled)', "permissions[1][#{cf3.id}]" | |
199 |
|
199 | |||
200 | assert_select 'select[name=?][disabled=disabled]', "permissions[1][#{cf2.id}]" do |
|
200 | assert_select 'select[name=?][disabled=disabled]', "permissions[1][#{cf2.id}]" do | |
201 | assert_select 'option[value=][selected=selected]', :text => 'Hidden' |
|
201 | assert_select 'option[value=""][selected=selected]', :text => 'Hidden' | |
202 | end |
|
202 | end | |
203 | end |
|
203 | end | |
204 |
|
204 | |||
@@ -277,16 +277,16 class WorkflowsControllerTest < ActionController::TestCase | |||||
277 | assert_response :success |
|
277 | assert_response :success | |
278 | assert_template 'copy' |
|
278 | assert_template 'copy' | |
279 | assert_select 'select[name=source_tracker_id]' do |
|
279 | assert_select 'select[name=source_tracker_id]' do | |
280 | assert_select 'option[value=1]', :text => 'Bug' |
|
280 | assert_select 'option[value="1"]', :text => 'Bug' | |
281 | end |
|
281 | end | |
282 | assert_select 'select[name=source_role_id]' do |
|
282 | assert_select 'select[name=source_role_id]' do | |
283 | assert_select 'option[value=2]', :text => 'Developer' |
|
283 | assert_select 'option[value="2"]', :text => 'Developer' | |
284 | end |
|
284 | end | |
285 | assert_select 'select[name=?]', 'target_tracker_ids[]' do |
|
285 | assert_select 'select[name=?]', 'target_tracker_ids[]' do | |
286 | assert_select 'option[value=3]', :text => 'Support request' |
|
286 | assert_select 'option[value="3"]', :text => 'Support request' | |
287 | end |
|
287 | end | |
288 | assert_select 'select[name=?]', 'target_role_ids[]' do |
|
288 | assert_select 'select[name=?]', 'target_role_ids[]' do | |
289 | assert_select 'option[value=1]', :text => 'Manager' |
|
289 | assert_select 'option[value="1"]', :text => 'Manager' | |
290 | end |
|
290 | end | |
291 | end |
|
291 | end | |
292 |
|
292 |
@@ -269,7 +269,7 class AccountTest < ActionDispatch::IntegrationTest | |||||
269 | follow_redirect! |
|
269 | follow_redirect! | |
270 | assert_response :success |
|
270 | assert_response :success | |
271 | assert_select 'div.flash', :text => /new activation email/ |
|
271 | assert_select 'div.flash', :text => /new activation email/ | |
272 | assert_select 'div.flash a[href=/account/activation_email]' |
|
272 | assert_select 'div.flash a[href="/account/activation_email"]' | |
273 |
|
273 | |||
274 | # request a new action activation email |
|
274 | # request a new action activation email | |
275 | assert_difference 'ActionMailer::Base.deliveries.size' do |
|
275 | assert_difference 'ActionMailer::Base.deliveries.size' do |
@@ -101,8 +101,8 VIEW | |||||
101 | assert_response :success |
|
101 | assert_response :success | |
102 | assert_select 'p', :text => 'ContentForInsideHook content' |
|
102 | assert_select 'p', :text => 'ContentForInsideHook content' | |
103 | assert_select 'head' do |
|
103 | assert_select 'head' do | |
104 | assert_select 'script[src=/plugin_assets/test_plugin/javascripts/test_plugin.js]' |
|
104 | assert_select 'script[src="/plugin_assets/test_plugin/javascripts/test_plugin.js"]' | |
105 | assert_select 'link[href=/plugin_assets/test_plugin/stylesheets/test_plugin.css]' |
|
105 | assert_select 'link[href="/plugin_assets/test_plugin/stylesheets/test_plugin.css"]' | |
106 | end |
|
106 | end | |
107 | end |
|
107 | end | |
108 |
|
108 |
@@ -33,8 +33,8 class Redmine::BoolFieldFormatTest < ActionView::TestCase | |||||
33 | tag = field.format.edit_tag(self, 'abc', 'xyz', value) |
|
33 | tag = field.format.edit_tag(self, 'abc', 'xyz', value) | |
34 | assert_select_in tag, 'input[name=xyz]', 2 |
|
34 | assert_select_in tag, 'input[name=xyz]', 2 | |
35 | assert_select_in tag, 'input[id=abc]', 1 |
|
35 | assert_select_in tag, 'input[id=abc]', 1 | |
36 | assert_select_in tag, 'input[type=hidden][value=0]' |
|
36 | assert_select_in tag, 'input[type=hidden][value="0"]' | |
37 | assert_select_in tag, 'input[type=checkbox][value=1]' |
|
37 | assert_select_in tag, 'input[type=checkbox][value="1"]' | |
38 | end |
|
38 | end | |
39 |
|
39 | |||
40 | def test_check_box_should_be_checked_when_value_is_set |
|
40 | def test_check_box_should_be_checked_when_value_is_set | |
@@ -42,7 +42,7 class Redmine::BoolFieldFormatTest < ActionView::TestCase | |||||
42 | value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new, :value => '1') |
|
42 | value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new, :value => '1') | |
43 |
|
43 | |||
44 | tag = field.format.edit_tag(self, 'abc', 'xyz', value) |
|
44 | tag = field.format.edit_tag(self, 'abc', 'xyz', value) | |
45 | assert_select_in tag, 'input[type=checkbox][value=1][checked=checked]' |
|
45 | assert_select_in tag, 'input[type=checkbox][value="1"][checked=checked]' | |
46 | end |
|
46 | end | |
47 |
|
47 | |||
48 | def test_radio_style_should_render_edit_tag_as_radio_buttons |
|
48 | def test_radio_style_should_render_edit_tag_as_radio_buttons |
@@ -52,7 +52,7 class Redmine::ListFieldFormatTest < ActionView::TestCase | |||||
52 | tag = field.format.edit_tag(self, 'id', 'name', value) |
|
52 | tag = field.format.edit_tag(self, 'id', 'name', value) | |
53 | assert_select_in tag, 'select' do |
|
53 | assert_select_in tag, 'select' do | |
54 | assert_select 'option', 3 |
|
54 | assert_select 'option', 3 | |
55 | assert_select 'option[value=]' |
|
55 | assert_select 'option[value=""]' | |
56 | assert_select 'option[value=Foo]', :text => 'Foo' |
|
56 | assert_select 'option[value=Foo]', :text => 'Foo' | |
57 | assert_select 'option[value=Bar]', :text => 'Bar' |
|
57 | assert_select 'option[value=Bar]', :text => 'Bar' | |
58 | end |
|
58 | end | |
@@ -91,7 +91,7 class Redmine::ListFieldFormatTest < ActionView::TestCase | |||||
91 | assert_select_in tag, 'span' do |
|
91 | assert_select_in tag, 'span' do | |
92 | assert_select 'input[type=radio]', 3 |
|
92 | assert_select 'input[type=radio]', 3 | |
93 | assert_select 'label', :text => '(none)' do |
|
93 | assert_select 'label', :text => '(none)' do | |
94 | assert_select 'input[value=]' |
|
94 | assert_select 'input[value=""]' | |
95 | end |
|
95 | end | |
96 | assert_select 'label', :text => 'Foo' do |
|
96 | assert_select 'label', :text => 'Foo' do | |
97 | assert_select 'input[value=Foo]' |
|
97 | assert_select 'input[value=Foo]' |
General Comments 0
You need to be logged in to leave comments.
Login now