assert_generates (Test::Unit::Assertions)

    # File lib/action_controller/assertions.rb, line 145
          def assert_generates(expected_path, options, defaults={}, extras = {}, message=nil)
            clean_backtrace do
              expected_path = "/#{expected_path}" unless expected_path[0] == ?/
              # Load routes.rb if it hasn't been loaded.
              ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?

              generated_path, extra_keys = ActionController::Routing::Routes.generate(options, extras)
              found_extras = options.reject {|k, v| ! extra_keys.include? k}

              msg = build_message(message, "found extras <?>, not <?>", found_extras, extras)
              assert_block(msg) { found_extras == extras }

              msg = build_message(message, "The generated path <?> did not match <?>", generated_path,
                  expected_path)
              assert_block(msg) { expected_path == generated_path }
            end
          end