Problem with checkboxes in a table

18 views
Skip to first unread message

Erhard

unread,
Oct 7, 2010, 12:52:41 PM10/7/10
to webrat, adja.k...@vkb.de



I want to click on the checkbox on the 10th row of a table with wabrat
(in
a cucumber step)

Here the html output

<td class='zuwahl'>
<input id="checked_tags_10"
name="checked_tags
[]10" type="checkbox" value="document_10" />
</td>
</tr>


Here the corresponding haml

%td.zuwahl
- if document.mandatory_edit == nil
= check_box_tag("checked_tags[]#{document.id}",
"document_#{document.id}", :name => "wahl")





Here is a fragment of the stepdefinition :

When /^ich checkbox für "([^\"]*)" anwähle$/ do |docname|
document = Document.find_by_document_name(docname)
within("#document_#{document.id.to_s}") do |scope|
scope.check
"checked_tags_#{document.id.to_s}"
end


Its not a field in the database it a checkbox_tag without the
corresponding db-entry.


I think my scope.check "checked_tags_#{document.id.to_s}" is wrong
any
Do You have any ideas about that ?


Thanks


Erhard






Reply all
Reply to author
Forward
0 new messages