I have a class called
class Trainer {
   def showPeople(xhtml : Group) : NodeSeq = {
      val user : User = User.currentUser.open_!

I then want to write a unit test to test that returns proper xml.

The test is written as so
  def testValue() = {
    val xml =
                  <p:fullName>My Name</p:fullName>
                  <p:style>Fighter Style</p:style>
    val trainer = new Trainer()
    val output = trainer.showPeople(xml)

The User object inherits from MegaProtoUser.

The problem is I am not sure how to create a mock user and sign them
I have tried in my unit test
override def setUp : Unit = {
   val user = User.create

The mock user log-in *seems* to work fine but when
User.currentUser.open_! is called it throws an exception on trying to
open an empty box.

So either how do I do this or how do others do this type of testing.
I am sure I am missing something simple.


You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to