We will create three more tests: one for each actor that we have. They are located at ReactiveWebStore/test/
.
ChatUserActorSpec.scala
should look something like this:
class OutActor extends Actor { def receive = { case a:Any => Unit } } class ChatUserActorSpec extends PlaySpec { class Actors extends TestKit(ActorSystem("test")) "ChatUserActor" should { "joins the chat room and send a message" in new Actors { val probe1 = new TestProbe(system) val actorOutRef = TestActorRef[OutActor](Props[OutActor]) val actorRef = TestActorRef[ChatUserActor] (ChatUserActor.props(system)(actorOutRef)) val userActor = actorRef.underlyingActor assert(userActor.context != null) val msg = "testUser:test msg" probe1.send(actorRef,msg) ...