[glitchAPI] Update bookmarks migration, mix format
This commit is contained in:
parent
5b4eccf9e7
commit
622e5c83f6
|
@ -1,11 +1,9 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddBookmarkssToUsers do
|
||||
defmodule Pleroma.Repo.Migrations.AddBookmarksToUsers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:users) do
|
||||
add :bookmarks, {:array, :string}
|
||||
add :bookmarks, {:array, :string}, null: false, default: []
|
||||
end
|
||||
|
||||
create index(:users, [:bookmarks], using: :gin)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1438,18 +1438,21 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|
|||
"status" => "heweoo!"
|
||||
})
|
||||
|
||||
response = build_conn()
|
||||
response =
|
||||
build_conn()
|
||||
|> assign(:user, user)
|
||||
|> post("/api/v1/statuses/#{activity.id}/bookmark")
|
||||
|
||||
bookmarks = build_conn()
|
||||
bookmarks =
|
||||
build_conn()
|
||||
|> assign(:user, user)
|
||||
|> get("/api/v1/bookmarks")
|
||||
|
||||
assert [json_response(response, 200)] == json_response(bookmarks, 200)
|
||||
assert json_response(response, 200)["bookmarked"] == true
|
||||
|
||||
response2 = build_conn()
|
||||
response2 =
|
||||
build_conn()
|
||||
|> assign(:user, user)
|
||||
|> post("/api/v1/statuses/#{activity.id}/unbookmark")
|
||||
|
||||
|
|
Loading…
Reference in New Issue