- assert_select "> entry", :count => changesets.size
-
- changesets.each do |changeset|
- assert_select "> entry > id", changeset_url(:id => changeset.id)
+ assert_select "> entry", :count => changesets.size do |entries|
+ entries.zip(changesets) do |entry, changeset|
+ assert_select entry, "> id", :text => changeset_url(:id => changeset.id)
+
+ changeset_comment = changeset.tags["comment"]
+ if changeset_comment
+ assert_select entry, "> title", :count => 1, :text => "Changeset #{changeset.id} - #{changeset_comment}"
+ else
+ assert_select entry, "> title", :count => 1, :text => "Changeset #{changeset.id}"
+ end
+
+ assert_select entry, "> content > xhtml|div > xhtml|table" do
+ if changeset.tags.empty?
+ assert_select "> xhtml|tr > xhtml|td > xhtml|table", :count => 0
+ else
+ assert_select "> xhtml|tr > xhtml|td > xhtml|table", :count => 1 do
+ changeset.tags.each_key do |key|
+ assert_select "> xhtml|tr > xhtml|td", :text => /^#{key} = /
+ end
+ end
+ end
+ end
+ end