Permalink
Browse files

Added Merb.testing? method

This will check for either $TESTING (as used by merb internals/plugins) or
Merb::Config[:testing], which can be set in the config options. Having an
option like this provides a nice interface for the more public facing parts of
Merb; the auto-generated spec_helper.rb file for example can just use the test
environment setting.
  • Loading branch information...
2 parents 209ab5c + ea57d20 commit adad648d6c700c7ff450ae7a6f1abf3ca136264a @fabien fabien committed Mar 11, 2008
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/merb-core/test/helpers/request_helper.rb
@@ -97,6 +97,7 @@ def fake_request(env = {}, opt = {})
#---
# @public
def dispatch_to(controller_klass, action, params = {}, env = {}, &blk)
+ action = action.to_s
request_body = { :post_body => env[:post_body], :req => env[:req] }
request = fake_request(env.merge(
:query_string => Merb::Request.params_to_query_string(params)), request_body)

0 comments on commit adad648

Please sign in to comment.