test: add status posting with OGP link preview test
This commit is contained in:
		
							parent
							
								
									ebeabdcc72
								
							
						
					
					
						commit
						339c26e12b
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -136,6 +136,20 @@ test "posting a sensitive status", %{conn: conn} do
 | 
			
		|||
    assert Repo.get(Activity, id)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  test "posting a status with OGP link preview", %{conn: conn} do
 | 
			
		||||
    user = insert(:user)
 | 
			
		||||
 | 
			
		||||
    conn =
 | 
			
		||||
      conn
 | 
			
		||||
      |> assign(:user, user)
 | 
			
		||||
      |> post("/api/v1/statuses", %{
 | 
			
		||||
        "status" => "http://example.com/ogp"
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
    assert %{"id" => id, "card" => %{"title" => "The Rock"}} = json_response(conn, 200)
 | 
			
		||||
    assert Repo.get(Activity, id)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  test "posting a direct status", %{conn: conn} do
 | 
			
		||||
    user1 = insert(:user)
 | 
			
		||||
    user2 = insert(:user)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue