Issue 14: Functional tests issues warnings when using assert_select in Admin::ProductsController#save
Status:  Fixed
Owner: ----
Closed:  Apr 2008
Reported by edmundo...@gmail.com, Feb 18, 2008
What steps will reproduce the problem?
1. Create a functional test file for Admin::ProductsController.
2. Try to assert that it have a specified html tag. i.e:  assert_select
"div#errorExplanation" (Assert that it gave an error explanation)

What is the expected output? What do you see instead?
Is expected nothing but it prints:

ignoring attempt to close p with i
  opened at byte 12111, line 400
  closed at byte 12164, line 401
  attributes at open: {"class"=>"info"}
  text around open: " this product.\n</p>\n<p class=\"info\">\n\t(B"
  text around close: "bottom of this page)</i>\n</p>\n\n<!-- \n\tRE"

What version of the product are you using? On what operating system?
Checked out trunk. Ubuntu 7.04 

Please provide any additional information below.
Its just an initial <i> tag missed in
/vendor/plugins/substruct/app/views/admin/products/_crud_right.rhtml
...
(Button at the bottom of this page)</i>
...
 
Feb 18, 2008
#1 edmundo...@gmail.com
The above problem happens when trying to save using a page generated by the new template.

This problem extends a little further, in the edit template too.

It shows that:

ignoring attempt to close form with div
  opened at byte 2514, line 76
  closed at byte 23592, line 652
  attributes at open: {"enctype"=>"multipart/form-data",
"action"=>"/admin/products/save/2", "method"=>"post"}
  text around open: "t</a></li>\n  </ul>\n\n<form action=\"/admin"
  text around close: "ar\">&nbsp;</div>\n\n\n\n</div>\n\n<!-- end for"
ignoring attempt to close div with body
  opened at byte 1151, line 20
  closed at byte 23729, line 664
  attributes at open: {"id"=>"container"}
  text around open: "\n\t\n</head>\n<body>\n\n\n<div id=\"container\">"
  text around close: "ntainer -->\n</div>\n\n</body>\n</html>\n"
ignoring attempt to close div with html
  opened at byte 1151, line 20
  closed at byte 23737, line 665
  attributes at open: {"id"=>"container"}
  text around open: "\n\t\n</head>\n<body>\n\n\n<div id=\"container\">"
  text around close: "-->\n</div>\n\n</body>\n</html>\n"


Using http://validator.w3.org/ shows these errors and some more.

In /vendor/plugins/substruct/app/views/admin/products/edit.rhtml theres something
like that:

<div id="left">
...
<%= form_tag({:action => 'save', :id => @product}, :multipart => true) %>
...
</div>
<%= render(:partial => 'crud_right') %>
</form>

Its alternating open/close tags, so, its not valid.

SUGGESTION: Make this:

<%= form_tag({:action => 'save', :id => @product}, :multipart => true) %>
<div id="left">
...

Its the only option that doesn't break the layout, as a <div id="right"> is rendered
inside the form as well. The new.rhtml layout is already with the form tag above all,
this is the reason that it doesn't gave the same errors too.

Apr 7, 2008
Project Member #2 subim...@gmail.com
Fixed with change #44
Status: Fixed