Class: Spec::Rails::Example::RoutingHelpers::RouteFor
- Inherits:
-
Object
- Object
- Spec::Rails::Example::RoutingHelpers::RouteFor
- Includes:
- ParamsFromQueryString
- Defined in:
- lib/spec/rails/example/routing_helpers.rb
Instance Method Summary collapse
- #==(expected) ⇒ Object
-
#initialize(example, options) ⇒ RouteFor
constructor
A new instance of RouteFor.
Methods included from ParamsFromQueryString
Constructor Details
#initialize(example, options) ⇒ RouteFor
Returns a new instance of RouteFor.
19 20 21 |
# File 'lib/spec/rails/example/routing_helpers.rb', line 19 def initialize(example, ) @example, @options = example, end |
Instance Method Details
#==(expected) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/spec/rails/example/routing_helpers.rb', line 23 def ==(expected) if Hash === expected path, querystring = expected[:path].split('?') path = expected.merge(:path => path) else path, querystring = expected.split('?') end params = querystring.blank? ? {} : @example.params_from_querystring(querystring) @example.assert_recognizes(@options, path, params) true end |