You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: average_order_value_test.rb
    path of file: ./repos/workarea/core/test/queries/workarea/reports
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  module Reports
    class AverageOrderValueTest < TestCase
      def test_by_day
        Metrics::SalesByDay.inc(at: Time.zone.local(2018, 10, 27), orders: 1, revenue: 10.to_m)
        Metrics::SalesByDay.inc(at: Time.zone.local(2018, 10, 28), orders: 2, revenue: 15.to_m)
        Metrics::SalesByDay.inc(at: Time.zone.local(2018, 10, 29), orders: 3, revenue: 27.to_m)

        travel_to Time.zone.local(2018, 10, 30)
        report = AverageOrderValue.n
    
      def test_month
        Metrics::SalesByDay.inc(at: Time.zone.local(2018, 10, 29), orders: 1, revenue: 10.to_m)
        Metrics::SalesByDay.inc(at: Time.zone.local(2018, 10, 30), orders: 2, revenue: 15.to_m)
        Metrics::SalesByDay.inc(at: Time.zone.local(2018, 11, 1), orders: 3, revenue: 27.to_m)

        travel_to Time.zone.local(2018, 11, 2)
        report = AverageOrderValue.new(
          group_by: 'month',
          sort_by: '_id',
          sort_direction: 'desc'
        )

        assert_equal(2, report.results.length)

        assert_equal(2018, report.results.first['_id']['year'])
        assert_equal(11, report.results.first['_id']['month'])
        assert_equal(3, report.results.first['orders'])
        assert_equal(27, report.results.first['revenue'])
        assert_equal(9, report.results.first['average_order_value'])
        assert_equal(Time.zone.local(2018, 11, 1), report.results.first['starts_at'])

        assert_equal(2018, report.results.second['_id']['year'])
        assert_equal(10, report.results.second['_id']['month'])
        assert_equal(3, report.results.second['orders'])
        assert_equal(25, report.results.second['revenue'])
        assert_equal(25 / 3.to_f, report.results.second['average_order_value'])
        assert_equal(Time.zone.local(2018, 10, 29), report.results.second['starts_at'])
      end