]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/changeset_controller_test.rb
The test train rolls ever onwards...
[rails.git] / test / controllers / changeset_controller_test.rb
index 8eb9337447dd2a5fc65a60fa62055bffbc03cae6..7d751a5c75f700a37588f7b2d0093d9e70a6700a 100644 (file)
@@ -180,6 +180,7 @@ class ChangesetControllerTest < ActionController::TestCase
   # document structure.
   def test_read
     changeset_id = changesets(:normal_user_first_change).id
+
     get :read, :id => changeset_id
     assert_response :success, "cannot get first changeset"
 
@@ -193,6 +194,17 @@ class ChangesetControllerTest < ActionController::TestCase
     assert_select "osm[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
     assert_select "osm>changeset[id='#{changeset_id}']", 1
     assert_select "osm>changeset>discussion", 1
+    assert_select "osm>changeset>discussion>comment", 0
+
+    changeset_id = changesets(:normal_user_closed_change).id
+
+    get :read, :id => changeset_id, :include_discussion => true
+    assert_response :success, "cannot get closed changeset with comments"
+
+    assert_select "osm[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+    assert_select "osm>changeset[id='#{changeset_id}']", 1
+    assert_select "osm>changeset>discussion", 1
+    assert_select "osm>changeset>discussion>comment", 3
   end
 
   ##