Commit d735481e authored by jplang's avatar jplang

Quote values in DOM selectors for Nokogiri compatibility.

git-svn-id: https://svn.redmine.org/redmine/trunk@13619 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 4c8117c2
......@@ -75,7 +75,7 @@ class ActivitiesControllerTest < ActionController::TestCase
assert_template 'index'
assert_not_nil assigns(:events_by_day)
assert_select 'h2 a[href=/users/2]', :text => 'John Smith'
assert_select 'h2 a[href="/users/2"]', :text => 'John Smith'
i1 = Issue.find(1)
d1 = User.find(1).time_to_date(i1.created_on)
......
......@@ -129,7 +129,7 @@ class AdminControllerTest < ActionController::TestCase
assert_select 'tr#plugin-foo' do
assert_select 'td span.name', :text => 'Foo plugin'
assert_select 'td.configure a[href=/settings/plugin/foo]'
assert_select 'td.configure a[href="/settings/plugin/foo"]'
end
assert_select 'tr#plugin-bar' do
assert_select 'td span.name', :text => 'Bar'
......@@ -150,7 +150,7 @@ class AdminControllerTest < ActionController::TestCase
get :index
assert_response :success
assert_select 'div#admin-menu a[href=/foo/bar]', :text => 'Test'
assert_select 'div#admin-menu a[href="/foo/bar"]', :text => 'Test'
Redmine::MenuManager.map :admin_menu do |menu|
menu.delete :test_admin_menu_plugin_extension
......
......@@ -117,8 +117,8 @@ class BoardsControllerTest < ActionController::TestCase
assert_select 'select[name=?]', 'board[parent_id]' do
assert_select 'option', (Project.find(1).boards.size + 1)
assert_select 'option[value=]', :text => '&nbsp;'
assert_select 'option[value=1]', :text => 'Help'
assert_select 'option[value=""]', :text => '&nbsp;'
assert_select 'option[value="1"]', :text => 'Help'
end
end
......@@ -178,7 +178,7 @@ class BoardsControllerTest < ActionController::TestCase
assert_template 'edit'
assert_select 'select[name=?]', 'board[parent_id]' do
assert_select 'option[value=2][selected=selected]'
assert_select 'option[value="2"][selected=selected]'
end
end
......
......@@ -112,7 +112,7 @@ class EnumerationsControllerTest < ActionController::TestCase
assert_template 'destroy'
assert_not_nil Enumeration.find_by_id(4)
assert_select 'select[name=reassign_to_id]' do
assert_select 'option[value=6]', :text => 'High'
assert_select 'option[value="6"]', :text => 'High'
end
end
......
This diff is collapsed.
......@@ -75,7 +75,7 @@ class IssuesControllerTransactionTest < ActionController::TestCase
assert_select 'input[name=?][value=?]', 'conflict_resolution', 'add_notes'
assert_select 'label' do
assert_select 'input[name=?][value=?]', 'conflict_resolution', 'cancel'
assert_select 'a[href=/issues/2]'
assert_select 'a[href="/issues/2"]'
end
end
......
......@@ -46,7 +46,7 @@ class MyControllerTest < ActionController::TestCase
get :page
assert_response :success
assert_select 'tr.time-entry' do
assert_select 'td.subject a[href=/issues/1]'
assert_select 'td.subject a[href="/issues/1"]'
assert_select 'td.hours', :text => '2.50'
end
end
......@@ -119,7 +119,7 @@ class MyControllerTest < ActionController::TestCase
def test_my_account_should_show_destroy_link
get :account
assert_select 'a[href=/my/account/destroy]'
assert_select 'a[href="/my/account/destroy"]'
end
def test_get_destroy_should_display_the_destroy_confirmation
......
......@@ -28,7 +28,7 @@ class PrincipalMembershipsControllerTest < ActionController::TestCase
get :new, :user_id => 7
assert_response :success
assert_select 'label', :text => 'eCookbook' do
assert_select 'input[name=?][value=1]:not([disabled])', 'membership[project_ids][]'
assert_select 'input[name=?][value="1"]:not([disabled])', 'membership[project_ids][]'
end
end
......@@ -38,7 +38,7 @@ class PrincipalMembershipsControllerTest < ActionController::TestCase
get :new, :user_id => 7
assert_response :success
assert_select 'label', :text => 'eCookbook' do
assert_select 'input[name=?][value=1][disabled=disabled]', 'membership[project_ids][]'
assert_select 'input[name=?][value="1"][disabled=disabled]', 'membership[project_ids][]'
end
end
......
......@@ -103,9 +103,9 @@ class ProjectsControllerTest < ActionController::TestCase
assert_select 'select[name=?]', 'project[parent_id]' do
# parent project selected
assert_select 'option[value=1][selected=selected]'
assert_select 'option[value="1"][selected=selected]'
# no empty value
assert_select 'option[value=]', 0
assert_select 'option[value=""]', 0
end
end
......
......@@ -35,7 +35,7 @@ class QueriesControllerTest < ActionController::TestCase
get :new, :project_id => 1
assert_response :success
assert_template 'new'
assert_select 'input[name=?][value=0][checked=checked]', 'query[visibility]'
assert_select 'input[name=?][value="0"][checked=checked]', 'query[visibility]'
assert_tag :tag => 'input', :attributes => { :type => 'checkbox',
:name => 'query_is_for_all',
:checked => nil,
......@@ -197,7 +197,7 @@ class QueriesControllerTest < ActionController::TestCase
get :edit, :id => 4
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value=2][checked=checked]', 'query[visibility]'
assert_select 'input[name=?][value="2"][checked=checked]', 'query[visibility]'
assert_tag :tag => 'input', :attributes => { :type => 'checkbox',
:name => 'query_is_for_all',
:checked => 'checked',
......@@ -233,7 +233,7 @@ class QueriesControllerTest < ActionController::TestCase
get :edit, :id => 1
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value=2][checked=checked]', 'query[visibility]'
assert_select 'input[name=?][value="2"][checked=checked]', 'query[visibility]'
assert_tag :tag => 'input', :attributes => { :type => 'checkbox',
:name => 'query_is_for_all',
:checked => nil,
......
......@@ -62,7 +62,7 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
entry = assigns(:entries).detect {|e| e.name == 'subversion_test'}
assert_not_nil entry
assert_equal 'dir', entry.kind
assert_select 'tr.dir a[href=/projects/subproject1/repository/show/subversion_test]'
assert_select 'tr.dir a[href="/projects/subproject1/repository/show/subversion_test"]'
assert_tag 'input', :attributes => {:name => 'rev'}
assert_tag 'a', :content => 'Statistics'
......@@ -80,9 +80,9 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
get :show, :id => PRJ_ID, :repository_id => 'svn'
assert_response :success
assert_template 'show'
assert_select 'tr.dir a[href=/projects/subproject1/repository/svn/show/subversion_test]'
assert_select 'tr.dir a[href="/projects/subproject1/repository/svn/show/subversion_test"]'
# Repository menu should link to the main repo
assert_select '#main-menu a[href=/projects/subproject1/repository]'
assert_select '#main-menu a[href="/projects/subproject1/repository"]'
end
def test_browse_directory
......
......@@ -55,7 +55,7 @@ class RolesControllerTest < ActionController::TestCase
assert_select 'form' do
# blank name
assert_select 'input[name=?][value=]', 'role[name]'
assert_select 'input[name=?][value=""]', 'role[name]'
# edit_project permission checked
assert_select 'input[type=checkbox][name=?][value=edit_project][checked=checked]', 'role[permissions][]'
# add_project permission not checked
......@@ -63,7 +63,7 @@ class RolesControllerTest < ActionController::TestCase
assert_select 'input[type=checkbox][name=?][value=add_project][checked=checked]', 'role[permissions][]', 0
# workflow copy selected
assert_select 'select[name=?]', 'copy_workflow_from' do
assert_select 'option[value=2][selected=selected]'
assert_select 'option[value="2"][selected=selected]'
end
end
end
......
......@@ -93,19 +93,19 @@ class SettingsControllerTest < ActionController::TestCase
assert_select 'tr.commit-keywords:nth-child(1)' do
assert_select 'input[name=?][value=?]', 'settings[commit_update_keywords][keywords][]', 'fixes, resolves'
assert_select 'select[name=?]', 'settings[commit_update_keywords][status_id][]' do
assert_select 'option[value=3][selected=selected]'
assert_select 'option[value="3"][selected=selected]'
end
end
assert_select 'tr.commit-keywords:nth-child(2)' do
assert_select 'input[name=?][value=?]', 'settings[commit_update_keywords][keywords][]', 'closes'
assert_select 'select[name=?]', 'settings[commit_update_keywords][status_id][]' do
assert_select 'option[value=5][selected=selected]', :text => 'Closed'
assert_select 'option[value="5"][selected=selected]', :text => 'Closed'
end
assert_select 'select[name=?]', 'settings[commit_update_keywords][done_ratio][]' do
assert_select 'option[value=100][selected=selected]', :text => '100 %'
assert_select 'option[value="100"][selected=selected]', :text => '100 %'
end
assert_select 'select[name=?]', 'settings[commit_update_keywords][if_tracker_id][]' do
assert_select 'option[value=2][selected=selected]', :text => 'Feature request'
assert_select 'option[value="2"][selected=selected]', :text => 'Feature request'
end
end
end
......
......@@ -37,7 +37,7 @@ class TimelogControllerTest < ActionController::TestCase
assert_select 'input[name=?][type=hidden]', 'issue_id', 0
assert_select 'select[name=?]', 'time_entry[project_id]' do
# blank option for project
assert_select 'option[value=]'
assert_select 'option[value=""]'
end
end
......@@ -67,7 +67,7 @@ class TimelogControllerTest < ActionController::TestCase
assert_response :success
assert_template 'new'
assert_select 'select[name=?]', 'time_entry[project_id]' do
assert_select 'option[value=1][selected=selected]'
assert_select 'option[value="1"][selected=selected]'
end
end
......@@ -361,8 +361,8 @@ class TimelogControllerTest < ActionController::TestCase
# Activities
assert_select 'select[name=?]', 'time_entry[activity_id]' do
assert_select 'option[value=]', :text => '(No change)'
assert_select 'option[value=9]', :text => 'Design'
assert_select 'option[value=""]', :text => '(No change)'
assert_select 'option[value="9"]', :text => 'Design'
end
end
end
......
......@@ -127,7 +127,7 @@ class TrackersControllerTest < ActionController::TestCase
assert_select 'input[name=?][value=category_id]', 'tracker[core_fields][]'
assert_select 'input[name=?][value=category_id][checked=checked]', 'tracker[core_fields][]', 0
assert_select 'input[name=?][value=][type=hidden]', 'tracker[core_fields][]'
assert_select 'input[name=?][value=""][type=hidden]', 'tracker[core_fields][]'
end
def test_update
......@@ -187,10 +187,10 @@ class TrackersControllerTest < ActionController::TestCase
assert_select 'form' do
assert_select 'input[type=checkbox][name=?][value=assigned_to_id]', 'trackers[1][core_fields][]'
assert_select 'input[type=checkbox][name=?][value=2]', 'trackers[1][custom_field_ids][]'
assert_select 'input[type=checkbox][name=?][value="2"]', 'trackers[1][custom_field_ids][]'
assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][core_fields][]'
assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][custom_field_ids][]'
assert_select 'input[type=hidden][name=?][value=""]', 'trackers[1][core_fields][]'
assert_select 'input[type=hidden][name=?][value=""]', 'trackers[1][custom_field_ids][]'
end
end
......
......@@ -64,7 +64,7 @@ class UsersControllerTest < ActionController::TestCase
assert users.any?
assert_equal([], (users - Group.find(10).users))
assert_select 'select[name=group_id]' do
assert_select 'option[value=10][selected=selected]'
assert_select 'option[value="10"][selected=selected]'
end
end
......@@ -263,7 +263,7 @@ class UsersControllerTest < ActionController::TestCase
assert_template 'new'
assert_select 'select#pref_time_zone option[selected=selected]', :text => /Paris/
assert_select 'input#pref_no_self_notified[value=1][checked=checked]'
assert_select 'input#pref_no_self_notified[value="1"][checked=checked]'
end
def test_edit
......
......@@ -179,10 +179,10 @@ class WatchersControllerTest < ActionController::TestCase
xhr :get, :autocomplete_for_user, :q => 'mi', :project_id => 'ecookbook'
assert_response :success
assert_select 'input', :count => 4
assert_select 'input[name=?][value=1]', 'watcher[user_ids][]'
assert_select 'input[name=?][value=2]', 'watcher[user_ids][]'
assert_select 'input[name=?][value=8]', 'watcher[user_ids][]'
assert_select 'input[name=?][value=9]', 'watcher[user_ids][]'
assert_select 'input[name=?][value="1"]', 'watcher[user_ids][]'
assert_select 'input[name=?][value="2"]', 'watcher[user_ids][]'
assert_select 'input[name=?][value="8"]', 'watcher[user_ids][]'
assert_select 'input[name=?][value="9"]', 'watcher[user_ids][]'
end
def test_search_non_member_on_create
......@@ -202,9 +202,9 @@ class WatchersControllerTest < ActionController::TestCase
:object_type => 'issue', :project_id => 'ecookbook'
assert_response :success
assert_select 'input', :count => 3
assert_select 'input[name=?][value=2]', 'watcher[user_ids][]'
assert_select 'input[name=?][value=8]', 'watcher[user_ids][]'
assert_select 'input[name=?][value=9]', 'watcher[user_ids][]'
assert_select 'input[name=?][value="2"]', 'watcher[user_ids][]'
assert_select 'input[name=?][value="8"]', 'watcher[user_ids][]'
assert_select 'input[name=?][value="9"]', 'watcher[user_ids][]'
end
def test_search_and_add_non_member_on_update
......
......@@ -116,7 +116,7 @@ class WelcomeControllerTest < ActionController::TestCase
@request.session[:user_id] = 2
get :index
assert_select 'a[href=/logout][data-method=post]', :text => 'Sign out'
assert_select 'a[href="/logout"][data-method=post]', :text => 'Sign out'
end
def test_call_hook_mixed_in
......
......@@ -55,9 +55,9 @@ class WorkflowsControllerTest < ActionController::TestCase
assert_equal [2, 3, 5], assigns(:statuses).collect(&:id)
# allowed transitions
assert_select 'input[type=checkbox][name=?][value=1][checked=checked]', 'transitions[3][5][always]'
assert_select 'input[type=checkbox][name=?][value="1"][checked=checked]', 'transitions[3][5][always]'
# not allowed
assert_select 'input[type=checkbox][name=?][value=1]:not([checked=checked])', 'transitions[3][2][always]'
assert_select 'input[type=checkbox][name=?][value="1"]:not([checked=checked])', 'transitions[3][2][always]'
# unused
assert_select 'input[type=checkbox][name=?]', 'transitions[1][1][always]', 0
end
......@@ -135,13 +135,13 @@ class WorkflowsControllerTest < ActionController::TestCase
assert_response :success
assert_template 'permissions'
assert_select 'input[name=?][value=1]', 'role_id[]'
assert_select 'input[name=?][value=2]', 'tracker_id[]'
assert_select 'input[name=?][value="1"]', 'role_id[]'
assert_select 'input[name=?][value="2"]', 'tracker_id[]'
# Required field
assert_select 'select[name=?]', 'permissions[2][assigned_to_id]' do
assert_select 'option[value=]'
assert_select 'option[value=][selected=selected]', 0
assert_select 'option[value=""]'
assert_select 'option[value=""][selected=selected]', 0
assert_select 'option[value=readonly]', :text => 'Read-only'
assert_select 'option[value=readonly][selected=selected]', 0
assert_select 'option[value=required]', :text => 'Required'
......@@ -150,8 +150,8 @@ class WorkflowsControllerTest < ActionController::TestCase
# Read-only field
assert_select 'select[name=?]', 'permissions[3][fixed_version_id]' do
assert_select 'option[value=]'
assert_select 'option[value=][selected=selected]', 0
assert_select 'option[value=""]'
assert_select 'option[value=""][selected=selected]', 0
assert_select 'option[value=readonly]', :text => 'Read-only'
assert_select 'option[value=readonly][selected=selected]'
assert_select 'option[value=required]', :text => 'Required'
......@@ -160,8 +160,8 @@ class WorkflowsControllerTest < ActionController::TestCase
# Other field
assert_select 'select[name=?]', 'permissions[3][due_date]' do
assert_select 'option[value=]'
assert_select 'option[value=][selected=selected]', 0
assert_select 'option[value=""]'
assert_select 'option[value=""][selected=selected]', 0
assert_select 'option[value=readonly]', :text => 'Read-only'
assert_select 'option[value=readonly][selected=selected]', 0
assert_select 'option[value=required]', :text => 'Required'
......@@ -179,7 +179,7 @@ class WorkflowsControllerTest < ActionController::TestCase
# Custom field that is always required
# The default option is "(Required)"
assert_select 'select[name=?]', "permissions[3][#{cf.id}]" do
assert_select 'option[value=]'
assert_select 'option[value=""]'
assert_select 'option[value=readonly]', :text => 'Read-only'
assert_select 'option[value=required]', 0
end
......@@ -198,7 +198,7 @@ class WorkflowsControllerTest < ActionController::TestCase
assert_select 'select[name=?]:not(.disabled)', "permissions[1][#{cf3.id}]"
assert_select 'select[name=?][disabled=disabled]', "permissions[1][#{cf2.id}]" do
assert_select 'option[value=][selected=selected]', :text => 'Hidden'
assert_select 'option[value=""][selected=selected]', :text => 'Hidden'
end
end
......@@ -277,16 +277,16 @@ class WorkflowsControllerTest < ActionController::TestCase
assert_response :success
assert_template 'copy'
assert_select 'select[name=source_tracker_id]' do
assert_select 'option[value=1]', :text => 'Bug'
assert_select 'option[value="1"]', :text => 'Bug'
end
assert_select 'select[name=source_role_id]' do
assert_select 'option[value=2]', :text => 'Developer'
assert_select 'option[value="2"]', :text => 'Developer'
end
assert_select 'select[name=?]', 'target_tracker_ids[]' do
assert_select 'option[value=3]', :text => 'Support request'
assert_select 'option[value="3"]', :text => 'Support request'
end
assert_select 'select[name=?]', 'target_role_ids[]' do
assert_select 'option[value=1]', :text => 'Manager'
assert_select 'option[value="1"]', :text => 'Manager'
end
end
......
......@@ -269,7 +269,7 @@ class AccountTest < ActionDispatch::IntegrationTest
follow_redirect!
assert_response :success
assert_select 'div.flash', :text => /new activation email/
assert_select 'div.flash a[href=/account/activation_email]'
assert_select 'div.flash a[href="/account/activation_email"]'
# request a new action activation email
assert_difference 'ActionMailer::Base.deliveries.size' do
......
......@@ -101,8 +101,8 @@ VIEW
assert_response :success
assert_select 'p', :text => 'ContentForInsideHook content'
assert_select 'head' do
assert_select 'script[src=/plugin_assets/test_plugin/javascripts/test_plugin.js]'
assert_select 'link[href=/plugin_assets/test_plugin/stylesheets/test_plugin.css]'
assert_select 'script[src="/plugin_assets/test_plugin/javascripts/test_plugin.js"]'
assert_select 'link[href="/plugin_assets/test_plugin/stylesheets/test_plugin.css"]'
end
end
......
......@@ -33,8 +33,8 @@ class Redmine::BoolFieldFormatTest < ActionView::TestCase
tag = field.format.edit_tag(self, 'abc', 'xyz', value)
assert_select_in tag, 'input[name=xyz]', 2
assert_select_in tag, 'input[id=abc]', 1
assert_select_in tag, 'input[type=hidden][value=0]'
assert_select_in tag, 'input[type=checkbox][value=1]'
assert_select_in tag, 'input[type=hidden][value="0"]'
assert_select_in tag, 'input[type=checkbox][value="1"]'
end
def test_check_box_should_be_checked_when_value_is_set
......@@ -42,7 +42,7 @@ class Redmine::BoolFieldFormatTest < ActionView::TestCase
value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new, :value => '1')
tag = field.format.edit_tag(self, 'abc', 'xyz', value)
assert_select_in tag, 'input[type=checkbox][value=1][checked=checked]'
assert_select_in tag, 'input[type=checkbox][value="1"][checked=checked]'
end
def test_radio_style_should_render_edit_tag_as_radio_buttons
......
......@@ -52,7 +52,7 @@ class Redmine::ListFieldFormatTest < ActionView::TestCase
tag = field.format.edit_tag(self, 'id', 'name', value)
assert_select_in tag, 'select' do
assert_select 'option', 3
assert_select 'option[value=]'
assert_select 'option[value=""]'
assert_select 'option[value=Foo]', :text => 'Foo'
assert_select 'option[value=Bar]', :text => 'Bar'
end
......@@ -91,7 +91,7 @@ class Redmine::ListFieldFormatTest < ActionView::TestCase
assert_select_in tag, 'span' do
assert_select 'input[type=radio]', 3
assert_select 'label', :text => '(none)' do
assert_select 'input[value=]'
assert_select 'input[value=""]'
end
assert_select 'label', :text => 'Foo' do
assert_select 'input[value=Foo]'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment