Module: Merb::Test::RouteHelper
- Includes:
- RequestHelper
- Included in:
- RSpec::Core::ExampleGroup, Spec::Matchers::MatcherDSL
- Defined in:
- merb-core/lib/merb-core/test/helpers/route_helper.rb
Instance Method Summary (collapse)
-
- (Hash) request_to(path, method = :get, env = {})
A hash containing the controller and action along with any parameters.
- - (Object) resource(*args)
- - (Object) url(*args)
Methods included from RequestHelper
#build_request, #check_request_for_route, #describe_input, #describe_request, #dispatch_request, #dispatch_to, #dispatch_with_basic_authentication_to, #fake_request, #merge_controller_and_action, #mock_request, #status_code, #with_cookies
Instance Method Details
- (Hash) request_to(path, method = :get, env = {})
A hash containing the controller and action along with any parameters
23 24 25 26 27 28 |
# File 'merb-core/lib/merb-core/test/helpers/route_helper.rb', line 23 def request_to(path, method = :get, env = {}) env[:request_method] ||= method.to_s.upcase env[:request_uri] = path check_request_for_route(build_request({}, env)) end |
- (Object) resource(*args)
13 14 15 16 |
# File 'merb-core/lib/merb-core/test/helpers/route_helper.rb', line 13 def resource(*args) args << @request_params || {} Merb::Router.resource(*args) end |
- (Object) url(*args)
7 8 9 10 |
# File 'merb-core/lib/merb-core/test/helpers/route_helper.rb', line 7 def url(*args) args << (@request_params || {}) Merb::Router.url(*args) end |