Map.put_new(acc, m.timeline, %{
last_read_id: m.last_read_id,
version: m.lock_version,
- unread_count: m.unread_count,
- updated_at: NaiveDateTime.to_iso8601(m.updated_at)
+ updated_at: NaiveDateTime.to_iso8601(m.updated_at),
+ pleroma: %{
+ unread_count: m.unread_count
+ }
})
end)
end
|> json_response(200)
assert response == %{
- "notifications" => %{
- "last_read_id" => "69420",
- "unread_count" => 7,
- "updated_at" => NaiveDateTime.to_iso8601(marker.updated_at),
- "version" => 0
- }
- }
+ "notifications" => %{
+ "last_read_id" => "69420",
+ "updated_at" => NaiveDateTime.to_iso8601(marker.updated_at),
+ "version" => 0,
+ "pleroma" => %{ "unread_count" => 7 }
+ }
+ }
end
test "gets markers with missed scopes", %{conn: conn} do
"last_read_id" => "69420",
"updated_at" => _,
"version" => 0,
- "unread_count" => 0
+ "pleroma" => %{ "unread_count" => 0 }
}
} = response
end
assert response == %{
"notifications" => %{
"last_read_id" => "69888",
- "unread_count" => 0,
"updated_at" => NaiveDateTime.to_iso8601(marker.updated_at),
- "version" => 0
+ "version" => 0,
+ "pleroma" => %{ "unread_count" => 0 }
}
}
end
assert MarkerView.render("markers.json", %{markers: [marker1, marker2]}) == %{
"home" => %{
last_read_id: "42",
- unread_count: 0,
updated_at: NaiveDateTime.to_iso8601(marker2.updated_at),
- version: 0
+ version: 0,
+ pleroma: %{unread_count: 0}
},
"notifications" => %{
last_read_id: "17",
- unread_count: 5,
updated_at: NaiveDateTime.to_iso8601(marker1.updated_at),
- version: 0
+ version: 0,
+ pleroma: %{unread_count: 5}
}
}
end