]> git.openstreetmap.org Git - rails.git/commitdiff
Add user id to api trace output
authorAnton Khorev <tony29@yandex.ru>
Fri, 8 Sep 2023 14:13:57 +0000 (17:13 +0300)
committerAnton Khorev <tony29@yandex.ru>
Fri, 8 Sep 2023 14:13:57 +0000 (17:13 +0300)
app/views/api/traces/_trace.builder
test/controllers/api/traces_controller_test.rb

index 7efd640f5b132c483f6c76b855b8faf45616fc44..b56c902cd8ff8970a299d261cd96e86edded155f 100644 (file)
@@ -3,6 +3,7 @@
 attrs = {
   "id" => trace.id,
   "name" => trace.name,
+  "uid" => trace.user_id,
   "user" => trace.user.display_name,
   "visibility" => trace.visibility,
   "pending" => trace.inserted ? "false" : "true",
index d85e5e1a4e484c0379f0f48dfa32d4e5b7095dcc..468af852b7c2e37b89d802f024b55c8066f39daa 100644 (file)
@@ -52,6 +52,7 @@ module Api
       auth_header = basic_authorization_header public_trace_file.user.display_name, "test"
       get api_trace_path(public_trace_file), :headers => auth_header
       assert_response :success
+      assert_select "gpx_file[id='#{public_trace_file.id}'][uid='#{public_trace_file.user.id}']", 1
     end
 
     # Check an anonymous trace can't be specifically fetched by another user