features/step_definitions/table_steps.rb in activeadmin-0.6.0 vs features/step_definitions/table_steps.rb in activeadmin-0.6.1
- old
+ new
@@ -1,5 +1,10 @@
+Then /^I should see (\d+) ([\w]*) in the table$/ do |count, resource_type|
+ all("table.index_table tr > td:first").count.should eq count.to_i
+end
+
+# TODO: simplify this, if possible?
class HtmlTableToTextHelper
def initialize(html, table_css_selector = "table")
@html = html
@selector = table_css_selector
end
@@ -8,10 +13,10 @@
rows = Nokogiri::HTML(@html).css("#{@selector} tr")
rows.map do |row|
row.css('th, td').map do |td|
cell_to_string(td)
end
- end
+ end
end
private
def cell_to_string(td)