mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-19 11:45:01 +00:00
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into develop
This commit is contained in:
commit
87c2c42bad
2 changed files with 26 additions and 0 deletions
19
priv/repo/migrations/20170522160642_case_insensivtivity.exs
Normal file
19
priv/repo/migrations/20170522160642_case_insensivtivity.exs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.CaseInsensivtivity do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def up do
|
||||||
|
execute ("create extension if not exists citext")
|
||||||
|
alter table(:users) do
|
||||||
|
modify :email, :citext
|
||||||
|
modify :nickname, :citext
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down do
|
||||||
|
alter table(:users) do
|
||||||
|
modify :email, :string
|
||||||
|
modify :nickname, :string
|
||||||
|
end
|
||||||
|
execute ("drop extension if exists citext")
|
||||||
|
end
|
||||||
|
end
|
|
@ -114,6 +114,13 @@ defmodule Pleroma.UserTest do
|
||||||
assert user == fetched_user
|
assert user == fetched_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "gets an existing user, case insensitive" do
|
||||||
|
user = insert(:user, nickname: "nick")
|
||||||
|
fetched_user = User.get_or_fetch_by_nickname("NICK")
|
||||||
|
|
||||||
|
assert user == fetched_user
|
||||||
|
end
|
||||||
|
|
||||||
test "fetches an external user via ostatus if no user exists" do
|
test "fetches an external user via ostatus if no user exists" do
|
||||||
fetched_user = User.get_or_fetch_by_nickname("shp@social.heldscal.la")
|
fetched_user = User.get_or_fetch_by_nickname("shp@social.heldscal.la")
|
||||||
assert fetched_user.nickname == "shp@social.heldscal.la"
|
assert fetched_user.nickname == "shp@social.heldscal.la"
|
||||||
|
|
Loading…
Reference in a new issue