mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
8cf449b4ca
Why: * The `route` matcher can not only be used within controller example groups but also routing example groups. * Now that we are mixing matchers into specific example groups, `route` is no longer available in routing example groups. To satisfy the above: * Create a new module that contains a `route` method and returns a new instance of RouteMatcher. (RouteMatcher still lives in the ActionController namespace.) * Mix this module into routing example groups when the gem configuration block is run.
10 lines
190 B
Ruby
10 lines
190 B
Ruby
module Shoulda
|
|
module Matchers
|
|
module Routing
|
|
# @private
|
|
def route(method, path)
|
|
ActionController::RouteMatcher.new(method, path, self)
|
|
end
|
|
end
|
|
end
|
|
end
|