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)
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'
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
assert_select 'select[name=?]', 'board[parent_id]' do
assert_select 'option', (Project.find(1).boards.size + 1)
- assert_select 'option[value=]', :text => ' '
- assert_select 'option[value=1]', :text => 'Help'
+ assert_select 'option[value=""]', :text => ' '
+ assert_select 'option[value="1"]', :text => 'Help'
end
end
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
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
assert_nil assigns(:project)
# links to visible issues
- assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/
- assert_select 'a[href=/issues/5]', :text => /Subproject issue/
+ assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/
+ assert_select 'a[href="/issues/5"]', :text => /Subproject issue/
# private projects hidden
- assert_select 'a[href=/issues/6]', 0
- assert_select 'a[href=/issues/4]', 0
+ assert_select 'a[href="/issues/6"]', 0
+ assert_select 'a[href="/issues/4"]', 0
# project column
assert_select 'th', :text => /Project/
end
assert_not_nil assigns(:issues)
assert_nil assigns(:project)
- assert_select 'a[href=/issues/1]', 0
- assert_select 'a[href=/issues/5]', :text => /Subproject issue/
+ assert_select 'a[href="/issues/1"]', 0
+ assert_select 'a[href="/issues/5"]', :text => /Subproject issue/
end
def test_index_should_list_visible_issues_only
assert_template 'index'
assert_not_nil assigns(:issues)
- assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/
- assert_select 'a[href=/issues/5]', 0
+ assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/
+ assert_select 'a[href="/issues/5"]', 0
end
def test_index_with_project_and_subprojects
assert_template 'index'
assert_not_nil assigns(:issues)
- assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/
- assert_select 'a[href=/issues/5]', :text => /Subproject issue/
- assert_select 'a[href=/issues/6]', 0
+ assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/
+ assert_select 'a[href="/issues/5"]', :text => /Subproject issue/
+ assert_select 'a[href="/issues/6"]', 0
end
def test_index_with_project_and_subprojects_should_show_private_subprojects_with_permission
assert_template 'index'
assert_not_nil assigns(:issues)
- assert_select 'a[href=/issues/1]', :text => /#{ESCAPED_UCANT} print recipes/
- assert_select 'a[href=/issues/5]', :text => /Subproject issue/
- assert_select 'a[href=/issues/6]', :text => /Issue of a private subproject/
+ assert_select 'a[href="/issues/1"]', :text => /#{ESCAPED_UCANT} print recipes/
+ assert_select 'a[href="/issues/5"]', :text => /Subproject issue/
+ assert_select 'a[href="/issues/6"]', :text => /Issue of a private subproject/
end
def test_index_with_project_and_default_filter
def test_index_should_omit_page_param_in_export_links
get :index, :page => 2
assert_response :success
- assert_select 'a.atom[href=/issues.atom]'
- assert_select 'a.csv[href=/issues.csv]'
- assert_select 'a.pdf[href=/issues.pdf]'
+ assert_select 'a.atom[href="/issues.atom"]'
+ assert_select 'a.csv[href="/issues.csv"]'
+ assert_select 'a.pdf[href="/issues.pdf"]'
assert_select 'form#csv-export-form[action=/issues.csv]'
end
assert_select 'form#issue-form' do
assert_select 'select[name=?]', 'issue[priority_id]' do
- assert_select 'option[value=4]'
- assert_select 'option[value=15]', 0
+ assert_select 'option[value="4"]'
+ assert_select 'option[value="15"]', 0
end
end
end
assert_select 'div.subject' do
assert_select 'h3', 'Child Issue'
- assert_select 'a[href=/issues/1]'
+ assert_select 'a[href="/issues/1"]'
end
end
count = Issue.open.visible.count
assert_select 'div.next-prev-links' do
- assert_select 'a[href=/issues/2]', :text => /Previous/
- assert_select 'a[href=/issues/5]', :text => /Next/
+ assert_select 'a[href="/issues/2"]', :text => /Previous/
+ assert_select 'a[href="/issues/5"]', :text => /Next/
assert_select 'span.position', :text => "3 of #{count}"
end
end
assert_equal 12, assigns(:next_issue_id)
assert_select 'div.next-prev-links' do
- assert_select 'a[href=/issues/8]', :text => /Previous/
- assert_select 'a[href=/issues/12]', :text => /Next/
+ assert_select 'a[href="/issues/8"]', :text => /Previous/
+ assert_select 'a[href="/issues/12"]', :text => /Next/
end
end
assert_equal 7, assigns(:next_issue_id)
assert_select 'div.next-prev-links' do
- assert_select 'a[href=/issues/2]', :text => /Previous/
- assert_select 'a[href=/issues/7]', :text => /Next/
+ assert_select 'a[href="/issues/2"]', :text => /Previous/
+ assert_select 'a[href="/issues/7"]', :text => /Next/
end
end
assert_select 'div.next-prev-links' do
assert_select 'a', :text => /Previous/, :count => 0
- assert_select 'a[href=/issues/2]', :text => /Next/
+ assert_select 'a[href="/issues/2"]', :text => /Next/
end
end
assert_equal 1, assigns(:next_issue_id)
assert_select 'div.next-prev-links' do
- assert_select 'a[href=/issues/2]', :text => /Previous/
- assert_select 'a[href=/issues/1]', :text => /Next/
+ assert_select 'a[href="/issues/2"]', :text => /Previous/
+ assert_select 'a[href="/issues/1"]', :text => /Next/
end
end
get :show, :id => 2
assert_response :success
assert_select '.assigned-to' do
- assert_select 'a[href=/users/3]'
+ assert_select 'a[href="/users/3"]'
end
end
get :show, :id => 1
assert_select 'div#watchers ul' do
assert_select 'li' do
- assert_select 'a[href=/users/2]'
+ assert_select 'a[href="/users/2"]'
assert_select 'a img[alt=Delete]'
end
end
assert_select 'div#watchers ul' do
assert_select 'li' do
assert_select 'img.gravatar'
- assert_select 'a[href=/users/2]'
+ assert_select 'a[href="/users/2"]'
assert_select 'a img[alt=Delete]'
end
end
end
assert_select 'div.thumbnails' do
- assert_select 'a[href=/attachments/16/testfile.png]' do
- assert_select 'img[src=/attachments/thumbnail/16]'
+ assert_select 'a[href="/attachments/16/testfile.png"]' do
+ assert_select 'img[src="/attachments/thumbnail/16"]'
end
end
end
# Be sure we don't display inactive IssuePriorities
assert ! IssuePriority.find(15).active?
assert_select 'select[name=?]', 'issue[priority_id]' do
- assert_select 'option[value=15]', 0
+ assert_select 'option[value="15"]', 0
end
end
assert_response :success
assert_template 'new'
assert_select 'select[name=?]', 'issue[status_id]' do
- assert_select 'option[value=1][selected=selected]'
+ assert_select 'option[value="1"][selected=selected]'
end
- assert_select 'input[name=was_default_status][value=1]'
+ assert_select 'input[name=was_default_status][value="1"]'
end
def test_get_new_with_list_custom_field
assert_select 'select[name=?][multiple=multiple]', "issue[custom_field_values][#{field.id}][]" do
assert_select 'option', Project.find(1).users.count
- assert_select 'option[value=2]', :text => 'John Smith'
+ assert_select 'option[value="2"]', :text => 'John Smith'
end
assert_select 'input[name=?][type=hidden][value=?]', "issue[custom_field_values][#{field.id}][]", ''
end
assert_equal 'Custom field value', issue.custom_field_value(2)
assert_select 'select[name=?]', 'issue[tracker_id]' do
- assert_select 'option[value=3][selected=selected]'
+ assert_select 'option[value="3"][selected=selected]'
end
assert_select 'textarea[name=?]', 'issue[description]', :text => /Prefilled/
assert_select 'input[name=?][value=?]', 'issue[custom_field_values][2]', 'Custom field value'
assert_select 'textarea[name=?]', 'issue[description]', :text => 'This is a description'
assert_select 'select[name=?]', 'issue[priority_id]' do
- assert_select 'option[value=6][selected=selected]', :text => 'High'
+ assert_select 'option[value="6"][selected=selected]', :text => 'High'
end
# Custom fields
assert_select 'select[name=?]', 'issue[custom_field_values][1]' do
assert_response :success
assert_template 'new'
- assert_select 'input[name=?][value=2]:not(checked)', 'issue[watcher_user_ids][]'
- assert_select 'input[name=?][value=3][checked=checked]', 'issue[watcher_user_ids][]'
- assert_select 'input[name=?][value=8][checked=checked]', 'issue[watcher_user_ids][]'
+ assert_select 'input[name=?][value="2"]:not(checked)', 'issue[watcher_user_ids][]'
+ assert_select 'input[name=?][value="3"][checked=checked]', 'issue[watcher_user_ids][]'
+ assert_select 'input[name=?][value="8"][checked=checked]', 'issue[watcher_user_ids][]'
end
def test_post_create_should_ignore_non_safe_attributes
assert_select 'form[id=issue-form][action=/projects/ecookbook/issues]' do
assert_select 'select[name=?]', 'issue[project_id]' do
- assert_select 'option[value=1][selected=selected]', :text => 'eCookbook'
- assert_select 'option[value=2]:not([selected])', :text => 'OnlineStore'
+ assert_select 'option[value="1"][selected=selected]', :text => 'eCookbook'
+ assert_select 'option[value="2"]:not([selected])', :text => 'OnlineStore'
end
- assert_select 'input[name=copy_from][value=1]'
+ assert_select 'input[name=copy_from][value="1"]'
end
# "New issue" menu item should not link to copy
- assert_select '#main-menu a.new-issue[href=/projects/ecookbook/issues/new]'
+ assert_select '#main-menu a.new-issue[href="/projects/ecookbook/issues/new"]'
end
def test_new_as_copy_with_attachments_should_show_copy_attachments_checkbox
assert issue.attachments.count > 0
get :new, :project_id => 1, :copy_from => 3
- assert_select 'input[name=copy_attachments][type=checkbox][checked=checked][value=1]'
+ assert_select 'input[name=copy_attachments][type=checkbox][checked=checked][value="1"]'
end
def test_new_as_copy_without_attachments_should_not_show_copy_attachments_checkbox
issue = Issue.generate_with_descendants!
get :new, :project_id => 1, :copy_from => issue.id
- assert_select 'input[type=checkbox][name=copy_subtasks][checked=checked][value=1]'
+ assert_select 'input[type=checkbox][name=copy_subtasks][checked=checked][value="1"]'
end
def test_new_as_copy_with_invalid_issue_should_respond_with_404
assert_select 'form#issue-form[action=/projects/ecookbook/issues]' do
assert_select 'select[name=?]', 'issue[project_id]' do
- assert_select 'option[value=1]:not([selected])', :text => 'eCookbook'
- assert_select 'option[value=2][selected=selected]', :text => 'OnlineStore'
+ assert_select 'option[value="1"]:not([selected])', :text => 'eCookbook'
+ assert_select 'option[value="2"][selected=selected]', :text => 'OnlineStore'
end
- assert_select 'input[name=copy_from][value=1]'
+ assert_select 'input[name=copy_from][value="1"]'
end
end
# Be sure we don't display inactive IssuePriorities
assert ! IssuePriority.find(15).active?
assert_select 'select[name=?]', 'issue[priority_id]' do
- assert_select 'option[value=15]', 0
+ assert_select 'option[value="15"]', 0
end
end
assert_equal 5, issue.status_id
assert_select 'select[name=?]', 'issue[status_id]' do
- assert_select 'option[value=5][selected=selected]', :text => 'Closed'
+ assert_select 'option[value="5"][selected=selected]', :text => 'Closed'
end
assert_equal 7, issue.priority_id
assert_select 'select[name=?]', 'issue[priority_id]' do
- assert_select 'option[value=7][selected=selected]', :text => 'Urgent'
+ assert_select 'option[value="7"][selected=selected]', :text => 'Urgent'
end
assert_select 'input[name=?][value=2.5]', 'time_entry[hours]'
assert_select 'select[name=?]', 'time_entry[activity_id]' do
- assert_select 'option[value=10][selected=selected]', :text => 'Development'
+ assert_select 'option[value="10"][selected=selected]', :text => 'Development'
end
assert_select 'input[name=?][value=test_get_edit_with_params]', 'time_entry[comments]'
end
assert_select 'form#bulk_edit_form[action=?]', '/issues/bulk_update' do
assert_select 'input[name=?]', 'ids[]', 2
- assert_select 'input[name=?][value=1][type=hidden]', 'ids[]'
+ assert_select 'input[name=?][value="1"][type=hidden]', 'ids[]'
assert_select 'select[name=?]', 'issue[project_id]'
assert_select 'input[name=?]', 'issue[parent_issue_id]'
# Be sure we don't display inactive IssuePriorities
assert ! IssuePriority.find(15).active?
assert_select 'select[name=?]', 'issue[priority_id]' do
- assert_select 'option[value=15]', 0
+ assert_select 'option[value="15"]', 0
end
end
end
assert_response :success
assert_template 'bulk_edit'
assert_select 'select[name=?]', 'issue[tracker_id]' do
- assert_select 'option[value=2][selected=selected]'
+ assert_select 'option[value="2"][selected=selected]'
end
assert_select 'input[name=?][value=?]', 'issue[start_date]', 'foo'
end
get :index
assert_select 'div#quick-search form' do
- assert_select 'input[name=issues][value=1][type=hidden]'
+ assert_select 'input[name=issues][value="1"][type=hidden]'
end
end
end
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
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
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
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
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
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
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,
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',
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,
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'
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
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
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
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
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
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
# 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
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
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
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
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
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
: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
@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
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
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'
# 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'
# 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'
# 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
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
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
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
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
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
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
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
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]'