diff options
author | Timm <kaspth@gmail.com> | 2013-07-23 16:35:07 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-15 23:41:01 +0200 |
commit | 37ff080ca452160fb36b3a0df2d0b50995e4c801 (patch) | |
tree | db5ad3f79dd471af00960febed01b24cd5dc44d9 /actionview/test/template | |
parent | 37ac1c45a3a95e6d1eb01c7cf1f8dd0850f12de8 (diff) | |
download | rails-37ff080ca452160fb36b3a0df2d0b50995e4c801.tar.gz rails-37ff080ca452160fb36b3a0df2d0b50995e4c801.tar.bz2 rails-37ff080ca452160fb36b3a0df2d0b50995e4c801.zip |
Fixed Nokogiri::CSS::SyntaxErrors.
Fixed a Nokogiri::CSS::SyntaxError by using its expected format for unicode characters.
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/form_collections_helper_test.rb | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/actionview/test/template/form_collections_helper_test.rb b/actionview/test/template/form_collections_helper_test.rb index 5e991d87ad..57d9dce5cd 100644 --- a/actionview/test/template/form_collections_helper_test.rb +++ b/actionview/test/template/form_collections_helper_test.rb @@ -185,8 +185,8 @@ class FormCollectionsHelperTest < ActionView::TestCase p.collection_radio_buttons :category_id, collection, :id, :name end - assert_select 'input#post_category_id_1[type=radio][value=1]' - assert_select 'input#post_category_id_2[type=radio][value=2]' + assert_select 'input#post_category_id_1[type=radio][value="1"]' + assert_select 'input#post_category_id_2[type=radio][value="2"]' assert_select 'label[for=post_category_id_1]', 'Category 1' assert_select 'label[for=post_category_id_2]', 'Category 2' @@ -203,15 +203,15 @@ class FormCollectionsHelperTest < ActionView::TestCase collection = [Category.new(1, 'Category 1'), Category.new(2, 'Category 2')] with_collection_check_boxes :user, :category_ids, collection, :id, :name - assert_select 'input#user_category_ids_1[type=checkbox][value=1]' - assert_select 'input#user_category_ids_2[type=checkbox][value=2]' + assert_select 'input#user_category_ids_1[type=checkbox][value="1"]' + assert_select 'input#user_category_ids_2[type=checkbox][value="2"]' end test 'collection check boxes generates only one hidden field for the entire collection, to ensure something will be sent back to the server when posting an empty collection' do collection = [Category.new(1, 'Category 1'), Category.new(2, 'Category 2')] with_collection_check_boxes :user, :category_ids, collection, :id, :name - assert_select "input[type=hidden][name='user[category_ids][]'][value=]", :count => 1 + assert_select "input[type=hidden][name='user[category_ids][]'][value=\"\"]", :count => 1 end test 'collection check boxes generates a hidden field using the given :name in :html_options' do @@ -260,8 +260,8 @@ class FormCollectionsHelperTest < ActionView::TestCase collection = [[1, 'Category 1', {class: 'foo'}], [2, 'Category 2', {class: 'bar'}]] with_collection_check_boxes :user, :active, collection, :first, :second - assert_select 'input[type=checkbox][value=1].foo' - assert_select 'input[type=checkbox][value=2].bar' + assert_select 'input[type=checkbox][value="1"].foo' + assert_select 'input[type=checkbox][value="2"].bar' end test 'collection check boxes sets the label class defined inside the block' do @@ -286,27 +286,27 @@ class FormCollectionsHelperTest < ActionView::TestCase collection = (1..3).map{|i| [i, "Category #{i}"] } with_collection_check_boxes :user, :category_ids, collection, :first, :last, :checked => [1, 3] - assert_select 'input[type=checkbox][value=1][checked=checked]' - assert_select 'input[type=checkbox][value=3][checked=checked]' - assert_no_select 'input[type=checkbox][value=2][checked=checked]' + assert_select 'input[type=checkbox][value="1"][checked=checked]' + assert_select 'input[type=checkbox][value="3"][checked=checked]' + assert_no_select 'input[type=checkbox][value="2"][checked=checked]' end test 'collection check boxes accepts selected string values as :checked option' do collection = (1..3).map{|i| [i, "Category #{i}"] } with_collection_check_boxes :user, :category_ids, collection, :first, :last, :checked => ['1', '3'] - assert_select 'input[type=checkbox][value=1][checked=checked]' - assert_select 'input[type=checkbox][value=3][checked=checked]' - assert_no_select 'input[type=checkbox][value=2][checked=checked]' + assert_select 'input[type=checkbox][value="1"][checked=checked]' + assert_select 'input[type=checkbox][value="3"][checked=checked]' + assert_no_select 'input[type=checkbox][value="2"][checked=checked]' end test 'collection check boxes accepts a single checked value' do collection = (1..3).map{|i| [i, "Category #{i}"] } with_collection_check_boxes :user, :category_ids, collection, :first, :last, :checked => 3 - assert_select 'input[type=checkbox][value=3][checked=checked]' - assert_no_select 'input[type=checkbox][value=1][checked=checked]' - assert_no_select 'input[type=checkbox][value=2][checked=checked]' + assert_select 'input[type=checkbox][value="3"][checked=checked]' + assert_no_select 'input[type=checkbox][value="1"][checked=checked]' + assert_no_select 'input[type=checkbox][value="2"][checked=checked]' end test 'collection check boxes accepts selected values as :checked option and override the model values' do @@ -317,36 +317,36 @@ class FormCollectionsHelperTest < ActionView::TestCase p.collection_check_boxes :category_ids, collection, :first, :last, :checked => [1, 3] end - assert_select 'input[type=checkbox][value=1][checked=checked]' - assert_select 'input[type=checkbox][value=3][checked=checked]' - assert_no_select 'input[type=checkbox][value=2][checked=checked]' + assert_select 'input[type=checkbox][value="1"][checked=checked]' + assert_select 'input[type=checkbox][value="3"][checked=checked]' + assert_no_select 'input[type=checkbox][value="2"][checked=checked]' end test 'collection check boxes accepts multiple disabled items' do collection = (1..3).map{|i| [i, "Category #{i}"] } with_collection_check_boxes :user, :category_ids, collection, :first, :last, :disabled => [1, 3] - assert_select 'input[type=checkbox][value=1][disabled=disabled]' - assert_select 'input[type=checkbox][value=3][disabled=disabled]' - assert_no_select 'input[type=checkbox][value=2][disabled=disabled]' + assert_select 'input[type=checkbox][value="1"][disabled=disabled]' + assert_select 'input[type=checkbox][value="3"][disabled=disabled]' + assert_no_select 'input[type=checkbox][value="2"][disabled=disabled]' end test 'collection check boxes accepts single disabled item' do collection = (1..3).map{|i| [i, "Category #{i}"] } with_collection_check_boxes :user, :category_ids, collection, :first, :last, :disabled => 1 - assert_select 'input[type=checkbox][value=1][disabled=disabled]' - assert_no_select 'input[type=checkbox][value=3][disabled=disabled]' - assert_no_select 'input[type=checkbox][value=2][disabled=disabled]' + assert_select 'input[type=checkbox][value="1"][disabled=disabled]' + assert_no_select 'input[type=checkbox][value="3"][disabled=disabled]' + assert_no_select 'input[type=checkbox][value="2"][disabled=disabled]' end test 'collection check boxes accepts a proc to disabled items' do collection = (1..3).map{|i| [i, "Category #{i}"] } with_collection_check_boxes :user, :category_ids, collection, :first, :last, :disabled => proc { |i| i.first == 1 } - assert_select 'input[type=checkbox][value=1][disabled=disabled]' - assert_no_select 'input[type=checkbox][value=3][disabled=disabled]' - assert_no_select 'input[type=checkbox][value=2][disabled=disabled]' + assert_select 'input[type=checkbox][value="1"][disabled=disabled]' + assert_no_select 'input[type=checkbox][value="3"][disabled=disabled]' + assert_no_select 'input[type=checkbox][value="2"][disabled=disabled]' end test 'collection check boxes accepts multiple readonly items' do @@ -380,8 +380,8 @@ class FormCollectionsHelperTest < ActionView::TestCase collection = [[1, 'Category 1'], [2, 'Category 2']] with_collection_check_boxes :user, :category_ids, collection, :first, :last, {}, :class => 'check' - assert_select 'input.check[type=checkbox][value=1]' - assert_select 'input.check[type=checkbox][value=2]' + assert_select 'input.check[type=checkbox][value="1"]' + assert_select 'input.check[type=checkbox][value="2"]' end test 'collection check boxes with fields for' do @@ -390,8 +390,8 @@ class FormCollectionsHelperTest < ActionView::TestCase p.collection_check_boxes :category_ids, collection, :id, :name end - assert_select 'input#post_category_ids_1[type=checkbox][value=1]' - assert_select 'input#post_category_ids_2[type=checkbox][value=2]' + assert_select 'input#post_category_ids_1[type=checkbox][value="1"]' + assert_select 'input#post_category_ids_2[type=checkbox][value="2"]' assert_select 'label[for=post_category_ids_1]', 'Category 1' assert_select 'label[for=post_category_ids_2]', 'Category 2' |