projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Excoveralls for code coverage
[akkoma]
/
test
/
tasks
/
user_test.exs
diff --git
a/test/tasks/user_test.exs
b/test/tasks/user_test.exs
index 630ac06c1a60500d4b68e4f6decdaf767b706946..eaf4ecf8449bfe1881a1c99cae5d729d3f8c4e8d 100644
(file)
--- a/
test/tasks/user_test.exs
+++ b/
test/tasks/user_test.exs
@@
-50,7
+50,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ "created"
assert_received {:mix_shell, :info, [message]}
assert message =~ "created"
- user = User.get_by_nickname(unsaved.nickname)
+ user = User.get_
cached_
by_nickname(unsaved.nickname)
assert user.name == unsaved.name
assert user.email == unsaved.email
assert user.bio == unsaved.bio
assert user.name == unsaved.name
assert user.email == unsaved.email
assert user.bio == unsaved.bio
@@
-75,7
+75,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ "will not be created"
assert_received {:mix_shell, :info, [message]}
assert message =~ "will not be created"
- refute User.get_by_nickname(unsaved.nickname)
+ refute User.get_
cached_
by_nickname(unsaved.nickname)
end
end
end
end
@@
-88,7
+88,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ " deleted"
assert_received {:mix_shell, :info, [message]}
assert message =~ " deleted"
- user = User.get_by_nickname(user.nickname)
+ user = User.get_
cached_
by_nickname(user.nickname)
assert user.info.deactivated
end
assert user.info.deactivated
end
@@
-109,7
+109,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ " deactivated"
assert_received {:mix_shell, :info, [message]}
assert message =~ " deactivated"
- user = User.get_by_nickname(user.nickname)
+ user = User.get_
cached_
by_nickname(user.nickname)
assert user.info.deactivated
end
assert user.info.deactivated
end
@@
-121,7
+121,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ " activated"
assert_received {:mix_shell, :info, [message]}
assert message =~ " activated"
- user = User.get_by_nickname(user.nickname)
+ user = User.get_
cached_
by_nickname(user.nickname)
refute user.info.deactivated
end
refute user.info.deactivated
end
@@
-150,7
+150,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ "Successfully unsubscribed"
assert_received {:mix_shell, :info, [message]}
assert message =~ "Successfully unsubscribed"
- user = User.get_by_nickname(user.nickname)
+ user = User.get_
cached_
by_nickname(user.nickname)
assert Enum.empty?(user.following)
assert user.info.deactivated
end
assert Enum.empty?(user.following)
assert user.info.deactivated
end
@@
-178,7
+178,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ ~r/Admin status .* true/
assert_received {:mix_shell, :info, [message]}
assert message =~ ~r/Admin status .* true/
- user = User.get_by_nickname(user.nickname)
+ user = User.get_
cached_
by_nickname(user.nickname)
assert user.info.is_moderator
assert user.info.locked
assert user.info.is_admin
assert user.info.is_moderator
assert user.info.locked
assert user.info.is_admin
@@
-204,7
+204,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert_received {:mix_shell, :info, [message]}
assert message =~ ~r/Admin status .* false/
assert_received {:mix_shell, :info, [message]}
assert message =~ ~r/Admin status .* false/
- user = User.get_by_nickname(user.nickname)
+ user = User.get_
cached_
by_nickname(user.nickname)
refute user.info.is_moderator
refute user.info.locked
refute user.info.is_admin
refute user.info.is_moderator
refute user.info.locked
refute user.info.is_admin
@@
-248,11
+248,11
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert message =~ "Generated user invite token one time"
end
assert message =~ "Generated user invite token one time"
end
- test "token is generated with expire_at" do
+ test "token is generated with expire
s
_at" do
assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([
"invite",
assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([
"invite",
- "--expire-at",
+ "--expire
s
-at",
Date.to_string(Date.utc_today())
])
end)
Date.to_string(Date.utc_today())
])
end)
@@
-274,13
+274,13
@@
defmodule Mix.Tasks.Pleroma.UserTest do
assert message =~ "Generated user invite token reusable"
end
assert message =~ "Generated user invite token reusable"
end
- test "token is generated with max use and expire date" do
+ test "token is generated with max use and expire
s
date" do
assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([
"invite",
"--max-use",
"5",
assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([
"invite",
"--max-use",
"5",
- "--expire-at",
+ "--expire
s
-at",
Date.to_string(Date.utc_today())
])
end)
Date.to_string(Date.utc_today())
])
end)
@@
-295,7
+295,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
{:ok, invite} = Pleroma.UserInviteToken.create_invite()
{:ok, invite2} =
{:ok, invite} = Pleroma.UserInviteToken.create_invite()
{:ok, invite2} =
- Pleroma.UserInviteToken.create_invite(%{expire_at: Date.utc_today(), max_use: 15})
+ Pleroma.UserInviteToken.create_invite(%{expire
s
_at: Date.utc_today(), max_use: 15})
# assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([
# assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([
@@
-315,7
+315,7
@@
defmodule Mix.Tasks.Pleroma.UserTest do
describe "running revoke_invite" do
test "invite is revoked" do
describe "running revoke_invite" do
test "invite is revoked" do
- {:ok, invite} = Pleroma.UserInviteToken.create_invite(%{expire_at: Date.utc_today()})
+ {:ok, invite} = Pleroma.UserInviteToken.create_invite(%{expire
s
_at: Date.utc_today()})
assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([
assert capture_io(fn ->
Mix.Tasks.Pleroma.User.run([