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: star_products_test.rb
    path of file: ./repos/workarea/core/test/models/workarea/insights
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  module Insights
    class StarProductsTest < TestCase
      def test_generate_weekly!
        create_product_by_week(
          product_id: 'foo',
          views_percentile: 100,
          reporting_on: Time.current.last_week,
          conversion_rate: 0.1
        )
        create_product_by_week(
          product_id: 'bar',
          views_percentile: 
    
      def test_avg_conversion_rate_of_top_two_views_deciles
        create_product_by_week(
          views_percentile: 100,
          reporting_on: Time.current.last_week,
          conversion_rate: 0.1
        )
        create_product_by_week(
          views_percentile: 90,
          reporting_on: Time.current.last_week,
          conversion_rate: 0.2
        )
        create_product_by_week(
          views_percentile: 90,
          reporting_on: 2.weeks.ago,
          conversion_rate: 0.01
        )
        create_product_by_week(
          views_percentile: 80,
          reporting_on: Time.current.last_week,
          conversion_rate: 0.01
        )

        assert_in_delta(0.15, StarProducts.avg_conversion_rate_of_top_two_views_deciles)
      end