+
+ changeset = create(:changeset, :closed)
+ comment0, comment1, comment2 = create_list(:changeset_comment, 3, :changeset_id => changeset.id)
+
+ get changeset_show_path(changeset), :params => { :format => "json", :include_discussion => true }
+ assert_response :success, "cannot get closed changeset with comments"
+
+ js = ActiveSupport::JSON.decode(@response.body)
+ assert_not_nil js
+ assert_equal Settings.api_version, js["version"]
+ assert_equal Settings.generator, js["generator"]
+ assert_equal changeset.id, js["changeset"]["id"]
+ assert_not js["changeset"]["open"]
+ assert_equal changeset.created_at.xmlschema, js["changeset"]["created_at"]
+ assert_equal changeset.closed_at.xmlschema, js["changeset"]["closed_at"]
+ assert_equal 3, js["changeset"]["comments"].count
+ assert_equal comment0.id, js["changeset"]["comments"][0]["id"]
+ assert_equal comment1.id, js["changeset"]["comments"][1]["id"]
+ assert_equal comment2.id, js["changeset"]["comments"][2]["id"]