X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1f59507e78e16a281407f16b804e2111323bc767..9929c1b585bd0e0b088cc785af06720d46f2dcce:/test/controllers/api/changeset_comments_controller_test.rb?ds=sidebyside diff --git a/test/controllers/api/changeset_comments_controller_test.rb b/test/controllers/api/changeset_comments_controller_test.rb index 2d8818986..72463ed67 100644 --- a/test/controllers/api/changeset_comments_controller_test.rb +++ b/test/controllers/api/changeset_comments_controller_test.rb @@ -9,6 +9,10 @@ module Api { :path => "/api/0.6/changeset_comments", :method => :get }, { :controller => "api/changeset_comments", :action => "index" } ) + assert_routing( + { :path => "/api/0.6/changeset_comments.json", :method => :get }, + { :controller => "api/changeset_comments", :action => "index", :format => "json" } + ) assert_routing( { :path => "/api/0.6/changeset/1/comment", :method => :post }, { :controller => "api/changeset_comments", :action => "create", :id => "1" } @@ -65,6 +69,14 @@ module Api get api_changeset_comments_path(:user => user1.id) assert_response :success assert_comments_in_order [comment22, comment21, comment11] + + get api_changeset_comments_path(:from => "2023-03-15T00:00:00Z", :format => "json") + assert_response :success + js = ActiveSupport::JSON.decode(@response.body) + assert_not_nil js + assert_equal 2, js["comments"].count + assert_equal comment23.id, js["comments"][0]["id"] + assert_equal comment22.id, js["comments"][1]["id"] end def test_create_by_unauthorized @@ -224,8 +236,6 @@ module Api assert_equal 1, email.to.length assert_equal "[OpenStreetMap] #{commenter_user.display_name} has commented on one of your changesets", email.subject assert_equal creator_user.email, email.to.first - - ActionMailer::Base.deliveries.clear end def test_create_on_changeset_with_changeset_creator_and_other_user_subscribers @@ -255,8 +265,6 @@ module Api assert_not_nil email assert_equal 1, email.to.length assert_equal "[OpenStreetMap] #{commenter_user.display_name} has commented on a changeset you are interested in", email.subject - - ActionMailer::Base.deliveries.clear end ##