mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 11:19:19 +00:00
replace Repo.get_by(User, nickname: nickname)
with User.get_by_nickname(nickname)
in tests
This commit is contained in:
parent
9a59c26619
commit
20c619f85f
2 changed files with 7 additions and 7 deletions
|
@ -1021,7 +1021,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
|
||||||
|
|
||||||
user = json_response(conn, 200)
|
user = json_response(conn, 200)
|
||||||
|
|
||||||
fetched_user = Repo.get_by(User, nickname: "lain")
|
fetched_user = User.get_by_nickname("lain")
|
||||||
assert user == UserView.render("show.json", %{user: fetched_user})
|
assert user == UserView.render("show.json", %{user: fetched_user})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
||||||
|
|
||||||
{:ok, user} = TwitterAPI.register_user(data)
|
{:ok, user} = TwitterAPI.register_user(data)
|
||||||
|
|
||||||
fetched_user = Repo.get_by(User, nickname: "lain")
|
fetched_user = User.get_by_nickname("lain")
|
||||||
|
|
||||||
assert UserView.render("show.json", %{user: user}) ==
|
assert UserView.render("show.json", %{user: user}) ==
|
||||||
UserView.render("show.json", %{user: fetched_user})
|
UserView.render("show.json", %{user: fetched_user})
|
||||||
|
@ -293,7 +293,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
||||||
|
|
||||||
{:ok, user} = TwitterAPI.register_user(data)
|
{:ok, user} = TwitterAPI.register_user(data)
|
||||||
|
|
||||||
fetched_user = Repo.get_by(User, nickname: "lain")
|
fetched_user = User.get_by_nickname("lain")
|
||||||
|
|
||||||
assert UserView.render("show.json", %{user: user}) ==
|
assert UserView.render("show.json", %{user: user}) ==
|
||||||
UserView.render("show.json", %{user: fetched_user})
|
UserView.render("show.json", %{user: fetched_user})
|
||||||
|
@ -369,7 +369,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
||||||
|
|
||||||
{:ok, user} = TwitterAPI.register_user(data)
|
{:ok, user} = TwitterAPI.register_user(data)
|
||||||
|
|
||||||
fetched_user = Repo.get_by(User, nickname: "vinny")
|
fetched_user = User.get_by_nickname("vinny")
|
||||||
token = Repo.get_by(UserInviteToken, token: token.token)
|
token = Repo.get_by(UserInviteToken, token: token.token)
|
||||||
|
|
||||||
assert token.used == true
|
assert token.used == true
|
||||||
|
@ -393,7 +393,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
||||||
{:error, msg} = TwitterAPI.register_user(data)
|
{:error, msg} = TwitterAPI.register_user(data)
|
||||||
|
|
||||||
assert msg == "Invalid token"
|
assert msg == "Invalid token"
|
||||||
refute Repo.get_by(User, nickname: "GrimReaper")
|
refute User.get_by_nickname("GrimReaper")
|
||||||
end
|
end
|
||||||
|
|
||||||
@moduletag skip: "needs 'registrations_open: false' in config"
|
@moduletag skip: "needs 'registrations_open: false' in config"
|
||||||
|
@ -414,7 +414,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
||||||
{:error, msg} = TwitterAPI.register_user(data)
|
{:error, msg} = TwitterAPI.register_user(data)
|
||||||
|
|
||||||
assert msg == "Expired token"
|
assert msg == "Expired token"
|
||||||
refute Repo.get_by(User, nickname: "GrimReaper")
|
refute User.get_by_nickname("GrimReaper")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it returns the error on registration problems" do
|
test "it returns the error on registration problems" do
|
||||||
|
@ -429,7 +429,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
||||||
{:error, error_object} = TwitterAPI.register_user(data)
|
{:error, error_object} = TwitterAPI.register_user(data)
|
||||||
|
|
||||||
assert is_binary(error_object[:error])
|
assert is_binary(error_object[:error])
|
||||||
refute Repo.get_by(User, nickname: "lain")
|
refute User.get_by_nickname("lain")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it assigns an integer conversation_id" do
|
test "it assigns an integer conversation_id" do
|
||||||
|
|
Loading…
Reference in a new issue