Add support for unit testing RestHelper without full Jetty/Lift environment
If I have following example RestHelper:
it would be great to unit test it without running Jetty with full Lift on it.
For example by just calling:
or something in this manner.
object Rest extends RestHelper {
serve {
case "api" :: "info" :: Nil JsonGet req => {
val infos = Info.findAll
Extraction.decompose(infos)
}
}
}
it would be great to unit test it without running Jetty with full Lift on it.
For example by just calling:
val req = mockReq(JsonGet, "api" :: "info" :: Nil)
val response = Rest(req)
// ... check response
or something in this manner.
Leave a comment
on 2011-01-17 21:03 *
By dchenbecker
Assigned to changed from dpp to dchenbecker
Work remaining changed from 0.0 to 2.0
This should mesh nicely with this recent discussion:
http://groups.google.com/group/liftweb/browse_thread/thread/7a56e6bc09e3ff2d
http://groups.google.com/group/liftweb/browse_thread/thread/7a56e6bc09e3ff2d
on 2011-01-19 13:06 *
By dchenbecker
Make sure it works for URL rewriting, too
on 2011-01-26 23:48 *
By dchenbecker
Milestone changed from 2.3-RC1 to 2.3-M1
Work remaining changed from 2.0 to 0.0
Pending possible move to webkit or a new module
(In revision:0e49d258fc3a375255994a618575d6bd54c2f505) Added better support for unit testing
Closes #793
Added the MockWeb object and WebSpec trait.
MockWeb provides methods for unit testing
Reqs and S, and WebSpec extends Specification
to wrap MockWeb's methods into specs.
Also refactored MockHttpServletRequest to clean up
code, document, and improve functionality.
Branch: master
Closes #793
Added the MockWeb object and WebSpec trait.
MockWeb provides methods for unit testing
Reqs and S, and WebSpec extends Specification
to wrap MockWeb's methods into specs.
Also refactored MockHttpServletRequest to clean up
code, document, and improve functionality.
Branch: master
on 2011-02-01 03:45 *
By dchenbecker
(In revision:0e83647b803eaf799d3806c9bbc4bf74df67c0b3) Moved MockWeb and WebSpec to net.liftweb.mockweb
Fixes packaging issues. Refs #793
Branch: master
Fixes packaging issues. Refs #793
Branch: master
on 2011-02-02 20:06 *
By dchenbecker
(In revision:0e83647b803eaf799d3806c9bbc4bf74df67c0b3) Moved MockWeb and WebSpec to net.liftweb.mockweb
Fixes packaging issues. Refs #793
Branch: joni_json_scalaz
Fixes packaging issues. Refs #793
Branch: joni_json_scalaz