defmodule ShardTest.Conn do use ExUnit.Case doctest Shard.Application test "set nickname" do pk = Shard.Keys.get_any_identity pid = SApp.Identity.find_proc(pk) info = SApp.Identity.get_info(pid) new_info = %{info | nick: "test bot"} SApp.Identity.set_info(pid, new_info) end test "connect to other instance" do SNet.Manager.add_peer({:inet, {127, 0, 0, 1}, 4045}) receive do after 100 -> nil end end test "connect to chat rooms" do pk = Shard.Keys.get_any_identity pid1 = Shard.Manager.find_or_start %SApp.Chat.Manifest{channel: "test"} pid2 = Shard.Manager.find_or_start %SApp.Chat.Manifest{channel: "other_test"} SApp.Chat.chat_send(pid1, pk, "test msg 1") SApp.Chat.chat_send(pid2, pk, "test msg 2") end end