BBS: Tests and formatting.
This commit is contained in:
parent
3fc4ea45df
commit
10fdc080a0
3 changed files with 55 additions and 18 deletions
30
test/bbs/handler_test.exs
Normal file
30
test/bbs/handler_test.exs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
defmodule Pleroma.BBS.HandlerTest do
|
||||
use Pleroma.DataCase
|
||||
alias Pleroma.BBS.Handler
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Pleroma.User
|
||||
|
||||
import ExUnit.CaptureIO
|
||||
import Pleroma.Factory
|
||||
|
||||
test "getting the home timeline" do
|
||||
user = insert(:user)
|
||||
followed = insert(:user)
|
||||
|
||||
{:ok, user} = User.follow(user, followed)
|
||||
|
||||
{:ok, _first} = CommonAPI.post(user, %{"status" => "hey"})
|
||||
{:ok, _second} = CommonAPI.post(followed, %{"status" => "hello"})
|
||||
|
||||
output =
|
||||
capture_io(fn ->
|
||||
Handler.handle_command(%{user: user}, "home")
|
||||
end)
|
||||
|
||||
assert output =~ user.nickname
|
||||
assert output =~ followed.nickname
|
||||
|
||||
assert output =~ "hey"
|
||||
assert output =~ "hello"
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue