diff options
| author | rinpatch <rinpatch@sdf.org> | 2019-11-08 21:12:23 +0000 | 
|---|---|---|
| committer | rinpatch <rinpatch@sdf.org> | 2019-11-08 21:12:23 +0000 | 
| commit | d8e99189d07263d6c56b18a307802703a1fedff4 (patch) | |
| tree | 7b57a9d5fff7c75ee0757b4cdd11716f5182e271 /test | |
| parent | 5cbb1cd5502d3953a6f29d86d59dba547d12fee8 (diff) | |
| parent | 5b60d82592e3fd19646add354de4cde903abf38c (diff) | |
| download | pleroma-d8e99189d07263d6c56b18a307802703a1fedff4.tar.gz pleroma-d8e99189d07263d6c56b18a307802703a1fedff4.zip | |
Merge branch 'bugfix/containment-no-id' into 'develop'
object containment: handle all cases where ID is invalid (missing, nil, non-string)
Closes #1387
See merge request pleroma/pleroma!1955
Diffstat (limited to 'test')
| -rw-r--r-- | test/object/containment_test.exs | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/test/object/containment_test.exs b/test/object/containment_test.exs index 0dc2728b9..71fe5204c 100644 --- a/test/object/containment_test.exs +++ b/test/object/containment_test.exs @@ -67,6 +67,20 @@ defmodule Pleroma.Object.ContainmentTest do               end) =~                 "[error] Could not decode user at fetch https://n1u.moe/users/rye"      end + +    test "contain_origin_from_id() gracefully handles cases where no ID is present" do +      data = %{ +        "type" => "Create", +        "object" => %{ +          "id" => "http://example.net/~alyssa/activities/1234", +          "attributedTo" => "http://example.org/~alyssa" +        }, +        "actor" => "http://example.com/~bob" +      } + +      :error = +        Containment.contain_origin_from_id("http://example.net/~alyssa/activities/1234", data) +    end    end    describe "containment of children" do | 
