Skip to content

Commit

Permalink
Added Merb.testing? method
Browse files Browse the repository at this point in the history
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
fabien committed Mar 11, 2008
2 parents 209ab5c + ea57d20 commit adad648
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/merb-core/test/helpers/request_helper.rb
Expand Up @@ -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)
Expand Down

0 comments on commit adad648

Please sign in to comment.